2 * Acess2 C Library (Test)
3 * - By John Hodge (thePowersGang)
10 #define TST(_name, fmt, val) \
11 printf(_name" %"fmt" '"#val"': '"fmt"'\n", val)
13 int main(int argc, char *argv[])
15 printf("Hello World!\n");
16 TST("String", "%s", "teststring");
17 TST("String", "%.5s", "teststring");
18 TST("String", "%10.5s", "teststring");
19 TST("String", "%-10.5s", "teststring");
21 TST("Integer", "%i", 1234);
22 TST("Integer", "%d", 1234);
23 TST("Integer", "%u", 1234);
25 TST("Float", "%f", 3.1414926535);
26 TST("Float", "%f", 10.0);
27 TST("Float", "%f", -0.0);
28 TST("Float", "%.10f", 3.1414926535);
29 TST("Float", "%e", 3.1415926535);
30 TST("Float", "%g", 3.1415926535);
31 TST("Float", "%E", 1000000000.00);
32 TST("Float", "%a", 16.0);
33 TST("Float", "%a", 1024.0);
34 TST("Float", "%a", 1023.0);
35 TST("Float", "%A", 1000000000.00);