annotate tests/mini/classinfo1.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 test/classinfo1.d@d9d5d59873d8
children
rev   line source
lindquist@90 1 module classinfo1;
lindquist@90 2
lindquist@270 3 extern(C) int printf(char*, ...);
lindquist@270 4
lindquist@102 5 class NoPtrs
lindquist@90 6 {
lindquist@90 7 }
lindquist@90 8
lindquist@102 9 class HasPtrs
lindquist@102 10 {
lindquist@102 11 void* p;
lindquist@102 12 }
lindquist@102 13
lindquist@90 14 void main()
lindquist@90 15 {
lindquist@102 16 {
lindquist@102 17 ClassInfo ci = NoPtrs.classinfo;
lindquist@102 18 char[] name = ci.name;
lindquist@102 19 printf("%.*s\n", name.length, name.ptr);
lindquist@102 20 assert(ci.name == "classinfo1.NoPtrs");
lindquist@112 21 assert(ci.flags & 2);
lindquist@102 22 }
lindquist@102 23 {
lindquist@102 24 ClassInfo ci = HasPtrs.classinfo;
lindquist@102 25 char[] name = ci.name;
lindquist@102 26 printf("%.*s\n", name.length, name.ptr);
lindquist@102 27 assert(ci.name == "classinfo1.HasPtrs");
lindquist@112 28 assert(!(ci.flags & 2));
lindquist@102 29 }
lindquist@90 30 }