Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: runtime/vm/longjump_test.cc

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/longjump.cc ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/longjump.h" 5 #include "vm/longjump.h"
6 #include "vm/thread.h" 6 #include "vm/thread.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(LongJumpScope* jump) { 11 static void LongJumpHelper(LongJumpScope* jump) {
12 const Error& error = 12 const Error& error = Error::Handle(
13 Error::Handle(LanguageError::New( 13 LanguageError::New(String::Handle(String::New("LongJumpHelper"))));
14 String::Handle(String::New("LongJumpHelper"))));
15 jump->Jump(1, error); 14 jump->Jump(1, error);
16 UNREACHABLE(); 15 UNREACHABLE();
17 } 16 }
18 17
19 18
20 TEST_CASE(LongJump) { 19 TEST_CASE(LongJump) {
21 LongJumpScope* base = Thread::Current()->long_jump_base(); 20 LongJumpScope* base = Thread::Current()->long_jump_base();
22 { 21 {
23 LongJumpScope jump; 22 LongJumpScope jump;
24 if (setjmp(*jump.Set()) == 0) { 23 if (setjmp(*jump.Set()) == 0) {
25 LongJumpHelper(&jump); 24 LongJumpHelper(&jump);
26 UNREACHABLE(); 25 UNREACHABLE();
27 } 26 }
28 } 27 }
29 ASSERT(base == Thread::Current()->long_jump_base()); 28 ASSERT(base == Thread::Current()->long_jump_base());
30 } 29 }
31 30
32 } // namespace dart 31 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/longjump.cc ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698