root/trunk/test/combinations.d

Revision 815, 0.6 kB (checked in by braddr, 1 year ago)

Fix a number of tests to be 64 bit compatible.
Reintroduce the do_test.sh script for use with testing 64 bit (since the d version doesn't work yet).
Disable all the failing tests for 64 bit test runs.

Line 
1 extern(C) int printf(const char*, ...);
2
3 void main(string[] args)
4 {
5     args = args[1..$];
6     long combinations = 1 << args.length;
7     for (size_t i = 0; i < combinations; i++)
8     {
9         bool printed = false;
10
11         //printf("\"");
12         for (size_t j = 0; j < args.length; j++)
13         {
14             if (i & 1 << j)
15             {
16                 if (printed)
17                     printf(" ");
18                 printf("%.*s", args[j].length, args[j].ptr);
19                 printed = true;
20             }
21         }
22         //printf("\"\n");
23         printf("\n");
24     }
25 }
Note: See TracBrowser for help on using the browser.