OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/isolate.h" | 5 #include "vm/isolate.h" |
6 #include "vm/longjump.h" | 6 #include "vm/longjump.h" |
7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
8 | 8 |
9 namespace dart { | 9 namespace dart { |
10 | 10 |
11 static void LongJumpHelper(LongJump* jump) { | 11 static void LongJumpHelper(LongJump* jump) { |
12 jump->Jump(1, "LongJump Test"); | 12 const Error& error = |
| 13 Error::Handle(LanguageError::New( |
| 14 String::Handle(String::New("LongJumpHelper")))); |
| 15 jump->Jump(1, error); |
13 UNREACHABLE(); | 16 UNREACHABLE(); |
14 } | 17 } |
15 | 18 |
16 | 19 |
17 TEST_CASE(LongJump) { | 20 TEST_CASE(LongJump) { |
18 LongJump jump; | 21 LongJump jump; |
19 if (setjmp(*jump.Set()) == 0) { | 22 if (setjmp(*jump.Set()) == 0) { |
20 LongJumpHelper(&jump); | 23 LongJumpHelper(&jump); |
21 UNREACHABLE(); | 24 UNREACHABLE(); |
22 } | 25 } |
23 } | 26 } |
24 | 27 |
25 } // namespace dart | 28 } // namespace dart |
OLD | NEW |