annotate run/typeid_26.d @ 535:0db095345640

TypeInfo_Array Burton Radons <burton-radons@smocky.com> 2005-05-08 news:d5lotd$29j1$1@digitaldaemon.com
author thomask
date Sat, 14 May 2005 05:43:26 +0000
parents 111c6744074d
children 7e8e5013a030
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
133
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
1 /* $HeadURL$
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
2 * $Date$
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
3 * $Author$
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
4 */
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
5
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
6 module dstress.run.typeid_26;
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
7
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
8 int main(){
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
9 TypeInfo ti = typeid(short[]);
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
10 assert(!(ti is null));
535
0db095345640 TypeInfo_Array
thomask
parents: 342
diff changeset
11 assert(ti);
342
111c6744074d typeid(type).tsize == type.sizeof
thomask
parents: 334
diff changeset
12 assert(ti.tsize==(short[]).sizeof);
334
c1ca2f37362b added TypeInfo.toString checks to detect 'cheating'
thomask
parents: 133
diff changeset
13 assert(ti.toString()=="short[]");
535
0db095345640 TypeInfo_Array
thomask
parents: 342
diff changeset
14
0db095345640 TypeInfo_Array
thomask
parents: 342
diff changeset
15 TypeInfo_Array ta = cast(TypeInfo_Array) ti;
0db095345640 TypeInfo_Array
thomask
parents: 342
diff changeset
16 assert(!(ta is null));
0db095345640 TypeInfo_Array
thomask
parents: 342
diff changeset
17 assert(ta);
0db095345640 TypeInfo_Array
thomask
parents: 342
diff changeset
18 assert(ta.tsize==(short[]).sizeof);
0db095345640 TypeInfo_Array
thomask
parents: 342
diff changeset
19 assert(ta.toString()=="short[]");
0db095345640 TypeInfo_Array
thomask
parents: 342
diff changeset
20
133
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
21 return 0;
f4e9069c7993 extended typeid/TypeInfo tests
thomask
parents:
diff changeset
22 }