| 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/utils.h" | 7 #include "platform/utils.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 &peer32, | 562 &peer32, |
| 563 ExternalStringCallbackFinalizer); | 563 ExternalStringCallbackFinalizer); |
| 564 EXPECT_VALID(obj32); | 564 EXPECT_VALID(obj32); |
| 565 void* api_peer32 = NULL; | 565 void* api_peer32 = NULL; |
| 566 EXPECT_VALID(Dart_ExternalStringGetPeer(obj32, &api_peer32)); | 566 EXPECT_VALID(Dart_ExternalStringGetPeer(obj32, &api_peer32)); |
| 567 EXPECT_EQ(api_peer32, &peer32); | 567 EXPECT_EQ(api_peer32, &peer32); |
| 568 | 568 |
| 569 Dart_ExitScope(); | 569 Dart_ExitScope(); |
| 570 } | 570 } |
| 571 | 571 |
| 572 EXPECT_EQ(peer8, 40); | 572 EXPECT_EQ(40, peer8); |
| 573 EXPECT_EQ(peer16, 41); | 573 EXPECT_EQ(41, peer16); |
| 574 EXPECT_EQ(peer32, 42); | 574 EXPECT_EQ(42, peer32); |
| 575 Isolate::Current()->heap()->CollectGarbage(Heap::kOld); | 575 Isolate::Current()->heap()->CollectGarbage(Heap::kOld); |
| 576 EXPECT_EQ(peer8, 40); | 576 EXPECT_EQ(40, peer8); |
| 577 EXPECT_EQ(peer16, 41); | 577 EXPECT_EQ(41, peer16); |
| 578 EXPECT_EQ(peer32, 42); | 578 EXPECT_EQ(42, peer32); |
| 579 Isolate::Current()->heap()->CollectGarbage(Heap::kNew); | 579 Isolate::Current()->heap()->CollectGarbage(Heap::kNew); |
| 580 EXPECT_EQ(peer8, 80); | 580 EXPECT_EQ(80, peer8); |
| 581 EXPECT_EQ(peer16, 82); | 581 EXPECT_EQ(82, peer16); |
| 582 EXPECT_EQ(peer32, 84); | 582 EXPECT_EQ(84, peer32); |
| 583 } | 583 } |
| 584 | 584 |
| 585 | 585 |
| 586 TEST_CASE(ListAccess) { | 586 TEST_CASE(ListAccess) { |
| 587 const char* kScriptChars = | 587 const char* kScriptChars = |
| 588 "List testMain() {" | 588 "List testMain() {" |
| 589 " List a = new List();" | 589 " List a = new List();" |
| 590 " a.add(10);" | 590 " a.add(10);" |
| 591 " a.add(20);" | 591 " a.add(20);" |
| 592 " a.add(30);" | 592 " a.add(30);" |
| (...skipping 4098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4691 // We should have received the expected number of interrupts. | 4691 // We should have received the expected number of interrupts. |
| 4692 EXPECT_EQ(kInterruptCount, interrupt_count); | 4692 EXPECT_EQ(kInterruptCount, interrupt_count); |
| 4693 | 4693 |
| 4694 // Give the spawned thread enough time to properly exit. | 4694 // Give the spawned thread enough time to properly exit. |
| 4695 Isolate::SetInterruptCallback(saved); | 4695 Isolate::SetInterruptCallback(saved); |
| 4696 } | 4696 } |
| 4697 | 4697 |
| 4698 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 4698 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 4699 | 4699 |
| 4700 } // namespace dart | 4700 } // namespace dart |
| OLD | NEW |