Mercurial > projects > dstress
annotate nocompile/delete_02.d @ 1586:a74f0139fc3d
Fix tests using typeof on types.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 21 Aug 2008 15:42:21 +0200 |
parents | 592f9ae41ba5 |
children |
rev | line source |
---|---|
516 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @WARNING@ direct usage of Phobos's GC | |
6 | |
7 // __DSTRESS_ELINE__ 26 | |
8 | |
9 module dstress.nocompile.delete_02; | |
10 | |
11 import std.gc; | |
12 | |
13 int status; | |
14 | |
15 struct MyStruct{ | |
16 int i; | |
17 | |
18 delete(void* p){ | |
19 assert(status==0); | |
20 status--; | |
21 } | |
22 } | |
23 | |
24 void test(){ | |
25 MyStruct t; | |
26 delete t; | |
27 } | |
28 | |
29 int main(){ | |
30 test(); | |
31 std.gc.fullCollect(); | |
32 std.gc.minimize(); | |
33 assert(status==-1); | |
34 return 0; | |
35 } |