Mercurial > projects > dstress
comparison run/opCat_04.d @ 870:38ea1bb385b6
bit -> bool and __DSTRESS_TORTURE_BLOCK__ fixes
author | thomask |
---|---|
date | Sun, 26 Feb 2006 17:45:46 +0000 |
parents | c72584d36e0b |
children |
comparison
equal
deleted
inserted
replaced
869:899e2a9d39f1 | 870:38ea1bb385b6 |
---|---|
7 // @uri@ news:d36g3g$31ec$1@digitaldaemon.com | 7 // @uri@ news:d36g3g$31ec$1@digitaldaemon.com |
8 | 8 |
9 module dstress.run.opCat_04; | 9 module dstress.run.opCat_04; |
10 | 10 |
11 int main(){ | 11 int main(){ |
12 static bit[] a = [1, 1, 0, 1, 0]; | 12 static bool[] a = [true, true, false, true, false]; |
13 assert(a.length==5); | 13 assert(a.length==5); |
14 assert(a[0]==1); | 14 assert(a[0]==true); |
15 assert(a[1]==1); | 15 assert(a[1]==true); |
16 assert(a[2]==0); | 16 assert(a[2]==false); |
17 assert(a[3]==1); | 17 assert(a[3]==true); |
18 assert(a[4]==0); | 18 assert(a[4]==false); |
19 | 19 |
20 static bit[] b = [1, 0, 0, 1]; | 20 static bool[] b = [true, false, false, true]; |
21 assert(b.length==4); | 21 assert(b.length==4); |
22 assert(b[0]==1); | 22 assert(b[0]==true); |
23 assert(b[1]==0); | 23 assert(b[1]==false); |
24 assert(b[2]==0); | 24 assert(b[2]==false); |
25 assert(b[3]==1); | 25 assert(b[3]==true); |
26 | 26 |
27 | 27 |
28 bit[] c = a~b; | 28 bool[] c = a~b; |
29 assert(a.length==5); | 29 assert(a.length==5); |
30 assert(a[0]==1); | 30 assert(a[0]==true); |
31 assert(a[1]==1); | 31 assert(a[1]==true); |
32 assert(a[2]==0); | 32 assert(a[2]==false); |
33 assert(a[3]==1); | 33 assert(a[3]==true); |
34 assert(a[4]==0); | 34 assert(a[4]==false); |
35 | 35 |
36 assert(b.length==4); | 36 assert(b.length==4); |
37 assert(b[0]==1); | 37 assert(b[0]==true); |
38 assert(b[1]==0); | 38 assert(b[1]==false); |
39 assert(b[2]==0); | 39 assert(b[2]==false); |
40 assert(b[3]==1); | 40 assert(b[3]==true); |
41 | 41 |
42 assert(c.length==9); | 42 assert(c.length==9); |
43 assert(c[0]==1); | 43 assert(c[0]==true); |
44 assert(c[1]==1); | 44 assert(c[1]==true); |
45 assert(c[2]==0); | 45 assert(c[2]==false); |
46 assert(c[3]==1); | 46 assert(c[3]==true); |
47 assert(c[4]==0); | 47 assert(c[4]==false); |
48 assert(c[5]==1); | 48 assert(c[5]==true); |
49 assert(c[6]==0); | 49 assert(c[6]==false); |
50 assert(c[7]==0); | 50 assert(c[7]==false); |
51 assert(c[8]==1); | 51 assert(c[8]==true); |
52 | 52 |
53 return 0; | 53 return 0; |
54 } | 54 } |