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

Side by Side Diff: tests/language/src/BranchesTest.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « tests/language/src/BootstrapTest.dart ('k') | tests/language/src/BreakTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // Dart test for branches. Make sure that shortcuts work, even if they have
5 // to jump over several expressions.
6
7 class BranchesTest {
8 static bool f() {
9 Expect.equals("Never reached", 0);
10 return true;
11 }
12
13 static void testMain() {
14 int checkPointCounter = 1;
15 int checkPoint1 = 0;
16 int checkPoint2 = 0;
17 int checkPoint3 = 0;
18 int checkPoint4 = 0;
19 int checkPoint5 = 0;
20 int checkPoint6 = 0;
21 int i = 0;
22 for (int i = 0; i < 2; i++) {
23 if (i == 0) {
24 checkPoint1 += checkPointCounter++;
25 if (true || // Test branch-if-true.
26 f() ||
27 f() ||
28 f() ||
29 f() ||
30 f() ||
31 f() ||
32 f() ||
33 f() ||
34 f() ||
35 f() ||
36 f() ||
37 f() ||
38 f() ||
39 f() ||
40 f() ||
41 f() ||
42 f() ||
43 f() ||
44 f() ||
45 f() ||
46 f() ||
47 f() ||
48 f() ||
49 f() ||
50 f() ||
51 f() ||
52 f() ||
53 f() ||
54 f() ||
55 f() ||
56 f() ||
57 f() ||
58 f() ||
59 f() ||
60 f() ||
61 f() ||
62 f() ||
63 f() ||
64 f() ||
65 f() ||
66 f() ||
67 f() ||
68 f() ||
69 f() ||
70 f() ||
71 f() ||
72 f() ||
73 f() ||
74 f() ||
75 f() ||
76 f() ||
77 f() ||
78 f() ||
79 f()) {
80 checkPoint2 += checkPointCounter++;
81 }
82 } else { // Test branch (jumping over the else branch).
83 checkPoint3 += checkPointCounter++;
84 if (false) {
85 checkPoint4 = checkPointCounter++; // Never reached.
86 checkPoint4 = checkPointCounter++; // Never reached.
87 checkPoint4 = checkPointCounter++; // Never reached.
88 checkPoint4 = checkPointCounter++; // Never reached.
89 checkPoint4 = checkPointCounter++; // Never reached.
90 checkPoint4 = checkPointCounter++; // Never reached.
91 checkPoint4 = checkPointCounter++; // Never reached.
92 checkPoint4 = checkPointCounter++; // Never reached.
93 checkPoint4 = checkPointCounter++; // Never reached.
94 checkPoint4 = checkPointCounter++; // Never reached.
95 checkPoint4 = checkPointCounter++; // Never reached.
96 checkPoint4 = checkPointCounter++; // Never reached.
97 checkPoint4 = checkPointCounter++; // Never reached.
98 checkPoint4 = checkPointCounter++; // Never reached.
99 checkPoint4 = checkPointCounter++; // Never reached.
100 checkPoint4 = checkPointCounter++; // Never reached.
101 checkPoint4 = checkPointCounter++; // Never reached.
102 checkPoint4 = checkPointCounter++; // Never reached.
103 checkPoint4 = checkPointCounter++; // Never reached.
104 checkPoint4 = checkPointCounter++; // Never reached.
105 checkPoint4 = checkPointCounter++; // Never reached.
106 checkPoint4 = checkPointCounter++; // Never reached.
107 checkPoint4 = checkPointCounter++; // Never reached.
108 checkPoint4 = checkPointCounter++; // Never reached.
109 checkPoint4 = checkPointCounter++; // Never reached.
110 checkPoint4 = checkPointCounter++; // Never reached.
111 checkPoint4 = checkPointCounter++; // Never reached.
112 checkPoint4 = checkPointCounter++; // Never reached.
113 checkPoint4 = checkPointCounter++; // Never reached.
114 checkPoint4 = checkPointCounter++; // Never reached.
115 checkPoint4 = checkPointCounter++; // Never reached.
116 checkPoint4 = checkPointCounter++; // Never reached.
117 checkPoint4 = checkPointCounter++; // Never reached.
118 checkPoint4 = checkPointCounter++; // Never reached.
119 checkPoint4 = checkPointCounter++; // Never reached.
120 checkPoint4 = checkPointCounter++; // Never reached.
121 checkPoint4 = checkPointCounter++; // Never reached.
122 checkPoint4 = checkPointCounter++; // Never reached.
123 checkPoint4 = checkPointCounter++; // Never reached.
124 checkPoint4 = checkPointCounter++; // Never reached.
125 checkPoint4 = checkPointCounter++; // Never reached.
126 checkPoint4 = checkPointCounter++; // Never reached.
127 checkPoint4 = checkPointCounter++; // Never reached.
128 checkPoint4 = checkPointCounter++; // Never reached.
129 checkPoint4 = checkPointCounter++; // Never reached.
130 checkPoint4 = checkPointCounter++; // Never reached.
131 checkPoint4 = checkPointCounter++; // Never reached.
132 checkPoint4 = checkPointCounter++; // Never reached.
133 checkPoint4 = checkPointCounter++; // Never reached.
134 checkPoint4 = checkPointCounter++; // Never reached.
135 checkPoint4 = checkPointCounter++; // Never reached.
136 checkPoint4 = checkPointCounter++; // Never reached.
137 checkPoint4 = checkPointCounter++; // Never reached.
138 checkPoint4 = checkPointCounter++; // Never reached.
139 checkPoint4 = checkPointCounter++; // Never reached.
140 }
141 }
142 checkPoint5 += checkPointCounter++;
143 }
144 checkPoint6 += checkPointCounter++;
145 Expect.equals(1, checkPoint1);
146 Expect.equals(2, checkPoint2);
147 Expect.equals(4, checkPoint3);
148 Expect.equals(0, checkPoint4);
149 Expect.equals(8, checkPoint5);
150 Expect.equals(6, checkPoint6);
151 }
152 }
153
154 main() {
155 BranchesTest.testMain();
156 }
OLDNEW
« no previous file with comments | « tests/language/src/BootstrapTest.dart ('k') | tests/language/src/BreakTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698