Mercurial > projects > ldc
comparison tests/minicomplex/mem4.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module tangotests.mem4; | |
2 | |
3 import tango.stdc.stdio; | |
4 | |
5 class C { | |
6 int* ptr; | |
7 this() { | |
8 printf("this()\n"); | |
9 ptr = new int; | |
10 } | |
11 ~this() { | |
12 printf("~this()\n"); | |
13 delete ptr; | |
14 assert(ptr is null); | |
15 } | |
16 final void check() | |
17 { | |
18 printf("check()\n"); | |
19 assert(ptr !is null); | |
20 } | |
21 } | |
22 | |
23 void main() | |
24 { | |
25 C c = new C(); | |
26 c.check(); | |
27 delete c; | |
28 assert(c is null); | |
29 } |