338
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ Thomas Kuehne <thomas-dloop@kuehne.thisisspam.cn>
|
|
6 // @date@ 2004-10-22
|
|
7 // @uri@ news:clbr09$uc6$1@digitaldaemon.com
|
1487
|
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2140
|
338
|
9
|
|
10 // invariant for structs allowed since dmd-0.119
|
|
11
|
736
|
12 // __DSTRESS_TORTURE_BLOCK__ -release
|
|
13
|
338
|
14 module dstress.run.invariant_04;
|
|
15
|
|
16 bool tested;
|
|
17
|
|
18 struct MyStruct{
|
|
19 int i=1;
|
|
20
|
|
21 void test(){
|
|
22 }
|
|
23
|
1559
|
24 invariant(){
|
|
25 if(1 != i){
|
|
26 assert(0);
|
|
27 }
|
338
|
28 tested=true;
|
|
29 }
|
|
30 }
|
|
31
|
|
32 int main(){
|
|
33 MyStruct s;
|
|
34 assert(!tested);
|
|
35 s.test();
|
1559
|
36 if(!tested){
|
|
37 assert(0);
|
|
38 }
|
338
|
39 return 0;
|
|
40 }
|