annotate run/o/odd_bug_08_C.d @ 1320:daef239f37cf

sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
author thomask
date Sun, 31 Dec 2006 19:59:08 +0000
parents 08057f3259c9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1127
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
1 // $HeadURL$
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
2 // $Date$
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
3 // $Author$
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
4
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
5 // @author@ sugiyama <sugiyama563@msn.com>
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
6 // @date@ 2006-09-06
1320
daef239f37cf sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents: 1127
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=326
1127
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
8 // @desc@ [Issue 326] New: calculation bug
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
9
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
10 module dstress.run.o.odd_bug_08_C;
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
11
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
12 void check(int i){
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
13 static int expected = 1;
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
14
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
15 if(i != expected){
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
16 assert(0);
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
17 }
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
18
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
19 expected++;
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
20 }
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
21
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
22 const int x = 2, y = 1;
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
23
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
24 int main() {
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
25 int res = 0;
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
26 for(int i = 0; i < 10; i++) {
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
27 res = res + x - y;
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
28 check(res);
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
29 }
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
30
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
31 return 0;
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
32 }
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
33
08057f3259c9 [Issue 326] New: calculation bug
thomask
parents:
diff changeset
34