annotate tests/mini/vararg3.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/vararg3.d@d9d5d59873d8
children
rev   line source
lindquist@57 1 module vararg3;
lindquist@57 2
lindquist@270 3 import tango.core.Vararg;
lindquist@57 4
lindquist@57 5 void func(...)
lindquist@57 6 {
lindquist@57 7 assert(_arguments.length == 3);
lindquist@57 8 assert(_arguments[0] is typeid(int));
lindquist@57 9 assert(_arguments[1] is typeid(float));
lindquist@57 10 assert(_arguments[2] is typeid(long));
lindquist@57 11 assert(va_arg!(int)(_argptr) == 4);
lindquist@57 12 assert(va_arg!(float)(_argptr) == 2.5f);
lindquist@57 13 assert(va_arg!(long)(_argptr) == 42L);
lindquist@57 14 }
lindquist@57 15
lindquist@57 16 void main()
lindquist@57 17 {
lindquist@57 18 func(4, 2.5f, 42L);
lindquist@57 19 }