Index: runtime/vm/dart_api_impl_test.cc |
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc |
index f00f6cd39522a2110d6a9812e227ae1e945da8d6..7cb0bba0d3256e6c9be8a24f4e14dea2389e768b 100644 |
--- a/runtime/vm/dart_api_impl_test.cc |
+++ b/runtime/vm/dart_api_impl_test.cc |
@@ -906,6 +906,13 @@ static Dart_NativeFunction ByteDataNativeResolver(Dart_Handle name, |
TEST_CASE(ByteDataAccess) { |
const char* kScriptChars = |
"import 'dart:typeddata';\n" |
+ "class Expect {\n" |
+ " static equals(a, b) {\n" |
+ " if (a != b) {\n" |
+ " throw 'not equal. expected: $a, got: $b';\n" |
+ " }\n" |
+ " }\n" |
+ "}\n" |
"ByteData createByteData() native 'CreateByteData';" |
"ByteData main() {" |
" var length = 16;" |
@@ -961,6 +968,13 @@ TEST_CASE(ExternalByteDataAccess) { |
// appropriate getter instead of the host endian format used now. |
const char* kScriptChars = |
"import 'dart:typeddata';\n" |
+ "class Expect {\n" |
+ " static equals(a, b) {\n" |
+ " if (a != b) {\n" |
+ " throw 'not equal. expected: $a, got: $b';\n" |
+ " }\n" |
+ " }\n" |
+ "}\n" |
"ByteData createExternalByteData() native 'CreateExternalByteData';" |
"ByteData main() {" |
" var length = 16;" |
@@ -1073,6 +1087,13 @@ static void TestDirectAccess(Dart_Handle lib, |
TEST_CASE(TypedDataDirectAccess1) { |
const char* kScriptChars = |
"import 'dart:typeddata';\n" |
+ "class Expect {\n" |
+ " static equals(a, b) {\n" |
+ " if (a != b) {\n" |
+ " throw new Exception('not equal. expected: $a, got: $b');\n" |
+ " }\n" |
+ " }\n" |
+ "}\n" |
"void setMain(var a) {" |
" for (var i = 0; i < 10; i++) {" |
" a[i] = i;" |
@@ -1113,6 +1134,13 @@ TEST_CASE(TypedDataDirectAccess1) { |
TEST_CASE(TypedDataViewDirectAccess) { |
const char* kScriptChars = |
"import 'dart:typeddata';\n" |
+ "class Expect {\n" |
+ " static equals(a, b) {\n" |
+ " if (a != b) {\n" |
+ " throw 'not equal. expected: $a, got: $b';\n" |
+ " }\n" |
+ " }\n" |
+ "}\n" |
"void setMain(var list) {" |
" Expect.equals(10, list.length);" |
" for (var i = 0; i < 10; i++) {" |
@@ -1145,6 +1173,13 @@ TEST_CASE(TypedDataViewDirectAccess) { |
TEST_CASE(ByteDataDirectAccess) { |
const char* kScriptChars = |
"import 'dart:typeddata';\n" |
+ "class Expect {\n" |
+ " static equals(a, b) {\n" |
+ " if (a != b) {\n" |
+ " throw 'not equal. expected: $a, got: $b';\n" |
+ " }\n" |
+ " }\n" |
+ "}\n" |
"void setMain(var list) {" |
" Expect.equals(10, list.length);" |
" for (var i = 0; i < 10; i++) {" |
@@ -6649,8 +6684,10 @@ TEST_CASE(NativeFunctionClosure) { |
" var func = foo4; return func(i, j, k); }\n" |
"}\n" |
"class Expect {\n" |
- " static void equals(x, y) {\n" |
- " if (x != y) throw new Error('not equal');\n" |
+ " static equals(a, b) {\n" |
+ " if (a != b) {\n" |
+ " throw 'not equal. expected: $a, got: $b';\n" |
+ " }\n" |
" }\n" |
"}\n" |
"int testMain() {\n" |
@@ -6792,8 +6829,10 @@ TEST_CASE(NativeStaticFunctionClosure) { |
" var func = foo4; return func(i, j, k); }\n" |
"}\n" |
"class Expect {\n" |
- " static void equals(x, y) {\n" |
- " if (x != y) throw new Error('not equal');\n" |
+ " static equals(a, b) {\n" |
+ " if (a != b) {\n" |
+ " throw 'not equal. expected: $a, got: $b';\n" |
+ " }\n" |
" }\n" |
"}\n" |
"int testMain() {\n" |