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 "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
11 #include "vm/resolver.h" | 11 #include "vm/resolver.h" |
12 #include "vm/stack_frame.h" | 12 #include "vm/stack_frame.h" |
13 #include "vm/unit_test.h" | 13 #include "vm/unit_test.h" |
14 #include "vm/verifier.h" | 14 #include "vm/verifier.h" |
15 #include "vm/zone.h" | 15 #include "vm/zone.h" |
16 | 16 |
17 namespace dart { | 17 namespace dart { |
18 | 18 |
19 // Unit test for empty stack frame iteration. | 19 // Unit test for empty stack frame iteration. |
20 VM_TEST_CASE(EmptyStackFrameIteration) { | 20 ISOLATE_UNIT_TEST_CASE(EmptyStackFrameIteration) { |
21 StackFrameIterator iterator(StackFrameIterator::kValidateFrames); | 21 StackFrameIterator iterator(StackFrameIterator::kValidateFrames); |
22 EXPECT(!iterator.HasNextFrame()); | 22 EXPECT(!iterator.HasNextFrame()); |
23 EXPECT(iterator.NextFrame() == NULL); | 23 EXPECT(iterator.NextFrame() == NULL); |
24 VerifyPointersVisitor::VerifyPointers(); | 24 VerifyPointersVisitor::VerifyPointers(); |
25 } | 25 } |
26 | 26 |
27 | 27 |
28 // Unit test for empty dart stack frame iteration. | 28 // Unit test for empty dart stack frame iteration. |
29 VM_TEST_CASE(EmptyDartStackFrameIteration) { | 29 ISOLATE_UNIT_TEST_CASE(EmptyDartStackFrameIteration) { |
30 DartFrameIterator iterator; | 30 DartFrameIterator iterator; |
31 EXPECT(iterator.NextFrame() == NULL); | 31 EXPECT(iterator.NextFrame() == NULL); |
32 VerifyPointersVisitor::VerifyPointers(); | 32 VerifyPointersVisitor::VerifyPointers(); |
33 } | 33 } |
34 | 34 |
35 | 35 |
36 #define FUNCTION_NAME(name) StackFrame_##name | 36 #define FUNCTION_NAME(name) StackFrame_##name |
37 #define REGISTER_FUNCTION(name, count) {"" #name, FUNCTION_NAME(name), count}, | 37 #define REGISTER_FUNCTION(name, count) {"" #name, FUNCTION_NAME(name), count}, |
38 | 38 |
39 | 39 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 " }" | 317 " }" |
318 "}"; | 318 "}"; |
319 } | 319 } |
320 Dart_Handle lib = TestCase::LoadTestScript( | 320 Dart_Handle lib = TestCase::LoadTestScript( |
321 kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); | 321 kScriptChars, reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); |
322 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); | 322 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); |
323 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); | 323 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); |
324 } | 324 } |
325 | 325 |
326 } // namespace dart | 326 } // namespace dart |
OLD | NEW |