| 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 "bin/builtin.h" | 5 #include "bin/builtin.h" |
| 6 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
| 7 #include "include/dart_debugger_api.h" | 7 #include "include/dart_debugger_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 "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 8218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8229 EXPECT(Dart_IdentityEquals(str, utf16_str)); | 8229 EXPECT(Dart_IdentityEquals(str, utf16_str)); |
| 8230 for (intptr_t i = 0; i < length; i++) { | 8230 for (intptr_t i = 0; i < length; i++) { |
| 8231 EXPECT_EQ(0x4e8c, ext_utf16_str[i]); | 8231 EXPECT_EQ(0x4e8c, ext_utf16_str[i]); |
| 8232 } | 8232 } |
| 8233 | 8233 |
| 8234 Dart_ExitScope(); | 8234 Dart_ExitScope(); |
| 8235 } | 8235 } |
| 8236 EXPECT_EQ(40, peer8); | 8236 EXPECT_EQ(40, peer8); |
| 8237 EXPECT_EQ(41, peer16); | 8237 EXPECT_EQ(41, peer16); |
| 8238 EXPECT_EQ(42, canonical_str_peer); | 8238 EXPECT_EQ(42, canonical_str_peer); |
| 8239 Isolate::Current()->heap()->CollectGarbage(Heap::kNew); | 8239 Isolate::Current()->heap()->CollectAllGarbage(); |
| 8240 EXPECT_EQ(80, peer8); | 8240 EXPECT_EQ(80, peer8); |
| 8241 EXPECT_EQ(82, peer16); | 8241 EXPECT_EQ(82, peer16); |
| 8242 EXPECT_EQ(42, canonical_str_peer); // "*" Symbol is not removed on GC. | 8242 EXPECT_EQ(42, canonical_str_peer); // "*" Symbol is not removed on GC. |
| 8243 } | 8243 } |
| 8244 | 8244 |
| 8245 | 8245 |
| 8246 TEST_CASE(ExternalizeConstantStrings) { | 8246 TEST_CASE(ExternalizeConstantStrings) { |
| 8247 const char* kScriptChars = | 8247 const char* kScriptChars = |
| 8248 "String testMain() {\n" | 8248 "String testMain() {\n" |
| 8249 " return 'constant string';\n" | 8249 " return 'constant string';\n" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8507 NewString("main"), | 8507 NewString("main"), |
| 8508 1, | 8508 1, |
| 8509 dart_args); | 8509 dart_args); |
| 8510 int64_t value = 0; | 8510 int64_t value = 0; |
| 8511 result = Dart_IntegerToInt64(result, &value); | 8511 result = Dart_IntegerToInt64(result, &value); |
| 8512 EXPECT_VALID(result); | 8512 EXPECT_VALID(result); |
| 8513 EXPECT_EQ(6, value); | 8513 EXPECT_EQ(6, value); |
| 8514 } | 8514 } |
| 8515 | 8515 |
| 8516 } // namespace dart | 8516 } // namespace dart |
| OLD | NEW |