| 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 | |
| 3 // 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 |
| 4 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 5 | 4 |
| 6 #include "bin/builtin.h" | 5 #include "bin/builtin.h" |
| 7 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
| 8 #include "include/dart_debugger_api.h" | 7 #include "include/dart_debugger_api.h" |
| 9 #include "include/dart_mirrors_api.h" | 8 #include "include/dart_mirrors_api.h" |
| 10 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
| 11 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| 12 #include "platform/json.h" | 11 #include "platform/json.h" |
| (...skipping 6084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6097 EXPECT(Dart_IsInteger(result)); | 6096 EXPECT(Dart_IsInteger(result)); |
| 6098 value = 0; | 6097 value = 0; |
| 6099 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); | 6098 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); |
| 6100 EXPECT_EQ(123456, value); | 6099 EXPECT_EQ(123456, value); |
| 6101 | 6100 |
| 6102 // A NULL resolver is okay, but resolution will fail. | 6101 // A NULL resolver is okay, but resolution will fail. |
| 6103 result = Dart_SetNativeResolver(lib, NULL); | 6102 result = Dart_SetNativeResolver(lib, NULL); |
| 6104 EXPECT_VALID(result); | 6103 EXPECT_VALID(result); |
| 6105 | 6104 |
| 6106 EXPECT_ERROR(Dart_Invoke(type, NewString("baz"), 0, NULL), | 6105 EXPECT_ERROR(Dart_Invoke(type, NewString("baz"), 0, NULL), |
| 6107 "native function 'SomeNativeFunction3' cannot be found"); | 6106 "native function 'SomeNativeFunction3' (0 arguments) " |
| 6107 "cannot be found"); |
| 6108 } | 6108 } |
| 6109 | 6109 |
| 6110 | 6110 |
| 6111 // Test that an imported name does not clash with the same name defined | 6111 // Test that an imported name does not clash with the same name defined |
| 6112 // in the importing library. | 6112 // in the importing library. |
| 6113 TEST_CASE(ImportLibrary2) { | 6113 TEST_CASE(ImportLibrary2) { |
| 6114 const char* kScriptChars = | 6114 const char* kScriptChars = |
| 6115 "import 'library1_dart';\n" | 6115 "import 'library1_dart';\n" |
| 6116 "var foo;\n" | 6116 "var foo;\n" |
| 6117 "main() { foo = 0; }\n"; | 6117 "main() { foo = 0; }\n"; |
| (...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7912 NewString("main"), | 7912 NewString("main"), |
| 7913 1, | 7913 1, |
| 7914 dart_args); | 7914 dart_args); |
| 7915 int64_t value = 0; | 7915 int64_t value = 0; |
| 7916 result = Dart_IntegerToInt64(result, &value); | 7916 result = Dart_IntegerToInt64(result, &value); |
| 7917 EXPECT_VALID(result); | 7917 EXPECT_VALID(result); |
| 7918 EXPECT_EQ(6, value); | 7918 EXPECT_EQ(6, value); |
| 7919 } | 7919 } |
| 7920 | 7920 |
| 7921 } // namespace dart | 7921 } // namespace dart |
| OLD | NEW |