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

Side by Side Diff: tests/standalone/oom_error_stacktrace_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 months 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Dart test program for testing throw statement 4 // Dart test program for testing throw statement
5 // VMOptions=--old_gen_heap_size=512 5 // VMOptions=--old_gen_heap_size=512
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 class Helper1 { 9 class Helper1 {
10 static int func1() { 10 static int func1() {
11 return func2(); 11 return func2();
12 } 12 }
13
13 static int func2() { 14 static int func2() {
14 return func3(); 15 return func3();
15 } 16 }
17
16 static int func3() { 18 static int func3() {
17 return func4(); 19 return func4();
18 } 20 }
21
19 static int func4() { 22 static int func4() {
20 var i = 0; 23 var i = 0;
21 try { 24 try {
22 i = 10; 25 i = 10;
23 func5(); 26 func5();
24 } on OutOfMemoryError catch (e) { 27 } on OutOfMemoryError catch (e) {
25 i = 100; 28 i = 100;
26 Expect.isNull(e.stackTrace, "OOM should not have a stackTrace on throw"); 29 Expect.isNull(e.stackTrace, "OOM should not have a stackTrace on throw");
27 } 30 }
28 return i; 31 return i;
29 } 32 }
33
30 static List func5() { 34 static List func5() {
31 // Cause an OOM(out of memory) exception. 35 // Cause an OOM(out of memory) exception.
32 var l1 = new List(268435455); 36 var l1 = new List(268435455);
33 return l1; 37 return l1;
34 } 38 }
35 } 39 }
36 40
37 class OOMErrorStackTraceTest { 41 class OOMErrorStackTraceTest {
38 static testMain() { 42 static testMain() {
39 Expect.equals(100, Helper1.func1()); 43 Expect.equals(100, Helper1.func1());
40 } 44 }
41 } 45 }
42 46
43 main() { 47 main() {
44 OOMErrorStackTraceTest.testMain(); 48 OOMErrorStackTraceTest.testMain();
45 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698