Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/dart_api_impl.h" | 5 #include "vm/dart_api_impl.h" |
| 6 #include "bin/builtin.h" | 6 #include "bin/builtin.h" |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_mirrors_api.h" | 8 #include "include/dart_mirrors_api.h" |
| 9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
| 10 #include "include/dart_tools_api.h" | 10 #include "include/dart_tools_api.h" |
| (...skipping 5322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5333 arg_values[7].as_native_fields.values = native_fields2; | 5333 arg_values[7].as_native_fields.values = native_fields2; |
| 5334 Dart_Handle result = | 5334 Dart_Handle result = |
| 5335 Dart_GetNativeArguments(args, 9, arg_descriptors, arg_values); | 5335 Dart_GetNativeArguments(args, 9, arg_descriptors, arg_values); |
| 5336 EXPECT_VALID(result); | 5336 EXPECT_VALID(result); |
| 5337 | 5337 |
| 5338 EXPECT(arg_values[0].as_native_fields.values[0] == 30); | 5338 EXPECT(arg_values[0].as_native_fields.values[0] == 30); |
| 5339 EXPECT(arg_values[0].as_native_fields.values[1] == 40); | 5339 EXPECT(arg_values[0].as_native_fields.values[1] == 40); |
| 5340 | 5340 |
| 5341 EXPECT(arg_values[1].as_int32 == 77); | 5341 EXPECT(arg_values[1].as_int32 == 77); |
| 5342 | 5342 |
| 5343 EXPECT(arg_values[2].as_uint64 == 0xffffffffffffffffLL); | 5343 EXPECT(arg_values[2].as_uint64 == 0x8000000000000000LL); |
|
alexmarkov
2017/07/31 23:35:18
Note: this particular value is chosen for the foll
zra
2017/08/01 16:13:49
I think this would be good to add as a comment in
alexmarkov
2017/08/01 16:25:43
Done.
| |
| 5344 | 5344 |
| 5345 EXPECT(arg_values[3].as_bool == true); | 5345 EXPECT(arg_values[3].as_bool == true); |
| 5346 | 5346 |
| 5347 EXPECT(arg_values[4].as_double == 3.14); | 5347 EXPECT(arg_values[4].as_double == 3.14); |
| 5348 | 5348 |
| 5349 EXPECT_VALID(arg_values[5].as_string.dart_str); | 5349 EXPECT_VALID(arg_values[5].as_string.dart_str); |
| 5350 EXPECT(Dart_IsString(arg_values[5].as_string.dart_str)); | 5350 EXPECT(Dart_IsString(arg_values[5].as_string.dart_str)); |
| 5351 EXPECT_VALID(Dart_StringToCString(arg_values[5].as_string.dart_str, &cstr)); | 5351 EXPECT_VALID(Dart_StringToCString(arg_values[5].as_string.dart_str, &cstr)); |
| 5352 EXPECT_STREQ("abcdefg", cstr); | 5352 EXPECT_STREQ("abcdefg", cstr); |
| 5353 EXPECT(arg_values[5].as_string.peer == NULL); | 5353 EXPECT(arg_values[5].as_string.peer == NULL); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5439 " double arg4," | 5439 " double arg4," |
| 5440 " String arg5," | 5440 " String arg5," |
| 5441 " String arg6," | 5441 " String arg6," |
| 5442 " MyObject arg7) native 'NativeArgument_Access';" | 5442 " MyObject arg7) native 'NativeArgument_Access';" |
| 5443 "}" | 5443 "}" |
| 5444 "int testMain(String extstr) {" | 5444 "int testMain(String extstr) {" |
| 5445 " String str = 'abcdefg';" | 5445 " String str = 'abcdefg';" |
| 5446 " MyObject obj1 = MyObject.createObject();" | 5446 " MyObject obj1 = MyObject.createObject();" |
| 5447 " MyObject obj2 = MyObject.createObject();" | 5447 " MyObject obj2 = MyObject.createObject();" |
| 5448 " return obj1.accessFields(77," | 5448 " return obj1.accessFields(77," |
| 5449 " 0xffffffffffffffff," | 5449 " 1 << 63," |
| 5450 " true," | 5450 " true," |
| 5451 " 3.14," | 5451 " 3.14," |
| 5452 " str," | 5452 " str," |
| 5453 " extstr," | 5453 " extstr," |
| 5454 " obj2);" | 5454 " obj2);" |
| 5455 "}"; | 5455 "}"; |
| 5456 | 5456 |
| 5457 Dart_Handle lib = TestCase::LoadTestScript( | 5457 Dart_Handle lib = TestCase::LoadTestScript( |
| 5458 kScriptChars, | 5458 kScriptChars, |
| 5459 reinterpret_cast<Dart_NativeEntryResolver>(native_args_lookup)); | 5459 reinterpret_cast<Dart_NativeEntryResolver>(native_args_lookup)); |
| (...skipping 4162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9622 EXPECT_VALID(result); | 9622 EXPECT_VALID(result); |
| 9623 result = Dart_FinalizeLoading(false); | 9623 result = Dart_FinalizeLoading(false); |
| 9624 EXPECT_VALID(result); | 9624 EXPECT_VALID(result); |
| 9625 result = Dart_Invoke(lib, NewString("foozoo"), 0, NULL); | 9625 result = Dart_Invoke(lib, NewString("foozoo"), 0, NULL); |
| 9626 EXPECT(Dart_IsError(result)); | 9626 EXPECT(Dart_IsError(result)); |
| 9627 } | 9627 } |
| 9628 | 9628 |
| 9629 #endif // !PRODUCT | 9629 #endif // !PRODUCT |
| 9630 | 9630 |
| 9631 } // namespace dart | 9631 } // namespace dart |
| OLD | NEW |