X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibc.so_src%2FTEST_printf.c;h=43766944b8ec755c61cfb9fcd414a70c0c22d968;hb=4d0188930e7d0e571db78d1d2e3c4d9b3f0fe8fb;hp=5db673a39d0624cfa101bd83facaeb051eab1959;hpb=7dc9c3f82e28211bad0eef801b6a6dec349bfb50;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libc.so_src/TEST_printf.c b/Usermode/Libraries/libc.so_src/TEST_printf.c index 5db673a3..43766944 100644 --- a/Usermode/Libraries/libc.so_src/TEST_printf.c +++ b/Usermode/Libraries/libc.so_src/TEST_printf.c @@ -8,14 +8,14 @@ #include #define TST(_name, fmt, val) \ - printf(_name" %"fmt" "#val": "fmt"\n", val) + printf(_name" %"fmt" '"#val"': '"fmt"'\n", val) int main(int argc, char *argv[]) { - printf("Hello World\n"); + printf("Hello World!\n"); TST("String", "%s", "teststring"); TST("String", "%.5s", "teststring"); - TST("String", "%10.5s-", "teststring"); + TST("String", "%10.5s", "teststring"); TST("String", "%-10.5s", "teststring"); TST("Integer", "%i", 1234); @@ -23,8 +23,15 @@ int main(int argc, char *argv[]) TST("Integer", "%u", 1234); TST("Float", "%f", 3.1414926535); + TST("Float", "%f", 10.0); + TST("Float", "%f", -0.0); TST("Float", "%.10f", 3.1414926535); - TST("Float", "%e", 3.1414926535); - TST("Float", "%g", 3.1414926535); + TST("Float", "%e", 3.1415926535); + TST("Float", "%g", 3.1415926535); TST("Float", "%E", 1000000000.00); + TST("Float", "%a", 16.0); + TST("Float", "%a", 1024.0); + TST("Float", "%a", 1023.0); + TST("Float", "%A", 1000000000.00); + return 0; }