annotate run/typeid_79.d @ 1612:1f76d5b2f458

Fix typo in testcase run/typeid_79
author Christian Kamm <kamm incasoftware de>
date Sun, 10 May 2009 11:55:53 +0200
parents ecb96b2bf5cb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
630
ecb96b2bf5cb fixed module declaration
thomask
parents: 535
diff changeset
1 // $HeadURL$
ecb96b2bf5cb fixed module declaration
thomask
parents: 535
diff changeset
2 // $Date$
ecb96b2bf5cb fixed module declaration
thomask
parents: 535
diff changeset
3 // $Author$
136
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
4
630
ecb96b2bf5cb fixed module declaration
thomask
parents: 535
diff changeset
5 module dstress.run.typeid_79;
136
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
6
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
7 union MyUnion{
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
8 int i;
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
9 byte b;
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
10 }
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
11
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
12 int main(){
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
13 TypeInfo ti = typeid(MyUnion[]);
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
14 assert(!(ti is null));
535
0db095345640 TypeInfo_Array
thomask
parents: 467
diff changeset
15 assert(ti);
342
111c6744074d typeid(type).tsize == type.sizeof
thomask
parents: 334
diff changeset
16 assert(ti.tsize==(MyUnion[]).sizeof);
1612
1f76d5b2f458 Fix typo in testcase run/typeid_79
Christian Kamm <kamm incasoftware de>
parents: 630
diff changeset
17 assert(ti.toString()=="dstress.run.typeid_79.MyUnion[]");
535
0db095345640 TypeInfo_Array
thomask
parents: 467
diff changeset
18
0db095345640 TypeInfo_Array
thomask
parents: 467
diff changeset
19 TypeInfo_Array ta = cast(TypeInfo_Array) ti;
0db095345640 TypeInfo_Array
thomask
parents: 467
diff changeset
20 assert(!(ta is null));
0db095345640 TypeInfo_Array
thomask
parents: 467
diff changeset
21 assert(ta);
0db095345640 TypeInfo_Array
thomask
parents: 467
diff changeset
22 assert(ta.tsize==(MyUnion[]).sizeof);
1612
1f76d5b2f458 Fix typo in testcase run/typeid_79
Christian Kamm <kamm incasoftware de>
parents: 630
diff changeset
23 assert(ta.toString()=="dstress.run.typeid_79.MyUnion[]");
535
0db095345640 TypeInfo_Array
thomask
parents: 467
diff changeset
24
136
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
25 return 0;
98c7b15cc09e extended typeid test
thomask
parents:
diff changeset
26 }