| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "platform/json.h" | 7 #include "platform/json.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 str ^= Api::UnwrapHandle(handles[i]); | 1406 str ^= Api::UnwrapHandle(handles[i]); |
| 1407 EXPECT(str.Equals(kTestString1)); | 1407 EXPECT(str.Equals(kTestString1)); |
| 1408 } | 1408 } |
| 1409 for (int i = 1500; i < 2000; i++) { | 1409 for (int i = 1500; i < 2000; i++) { |
| 1410 String& str = String::Handle(); | 1410 String& str = String::Handle(); |
| 1411 str ^= Api::UnwrapHandle(handles[i]); | 1411 str ^= Api::UnwrapHandle(handles[i]); |
| 1412 EXPECT(str.Equals(kTestString2)); | 1412 EXPECT(str.Equals(kTestString2)); |
| 1413 } | 1413 } |
| 1414 } | 1414 } |
| 1415 EXPECT(scope == state->top_scope()); | 1415 EXPECT(scope == state->top_scope()); |
| 1416 EXPECT_EQ(2000, state->CountPersistentHandles()); | 1416 EXPECT_EQ(2001, state->CountPersistentHandles()); |
| 1417 Dart_ShutdownIsolate(); | 1417 Dart_ShutdownIsolate(); |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 | 1420 |
| 1421 // Test that we are able to create a persistent handle from a | 1421 // Test that we are able to create a persistent handle from a |
| 1422 // persistent handle. | 1422 // persistent handle. |
| 1423 UNIT_TEST_CASE(NewPersistentHandle_FromPersistentHandle) { | 1423 UNIT_TEST_CASE(NewPersistentHandle_FromPersistentHandle) { |
| 1424 TestIsolateScope __test_isolate__; | 1424 TestIsolateScope __test_isolate__; |
| 1425 | 1425 |
| 1426 Isolate* isolate = Isolate::Current(); | 1426 Isolate* isolate = Isolate::Current(); |
| (...skipping 6112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7539 NULL); | 7539 NULL); |
| 7540 int64_t value = 0; | 7540 int64_t value = 0; |
| 7541 result = Dart_IntegerToInt64(result, &value); | 7541 result = Dart_IntegerToInt64(result, &value); |
| 7542 EXPECT_VALID(result); | 7542 EXPECT_VALID(result); |
| 7543 EXPECT_EQ(260, value); | 7543 EXPECT_EQ(260, value); |
| 7544 } | 7544 } |
| 7545 | 7545 |
| 7546 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 7546 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 7547 | 7547 |
| 7548 } // namespace dart | 7548 } // namespace dart |
| OLD | NEW |