[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] tests: sprintf: signed ist nicht immer unsigned



* %[uoxX] erwarten einen unsigned int, keinen signed int.

Signed-off-by: Max Reitz <max@xxxxxxxxxx>
---
 tests/libc/sprintf.c |  306 +++++++++++++++++++++++++-------------------------
 1 files changed, 153 insertions(+), 153 deletions(-)

diff --git a/tests/libc/sprintf.c b/tests/libc/sprintf.c
index 17b5a95..1c3e6ab 100644
--- a/tests/libc/sprintf.c
+++ b/tests/libc/sprintf.c
@@ -57,14 +57,14 @@ int test_sprintf(void)
     TEST("-1024",           5, "%d",       -1024)
     TEST("1024",            4, "%i",       1024)
     TEST("-1024",           5, "%i",       -1024)
-    TEST("1024",            4, "%u",       1024)
-    TEST("4294966272",     10, "%u",       -1024)
-    TEST("777",             3, "%o",       0777)
-    TEST("37777777001",    11, "%o",       -0777)
-    TEST("1234abcd",        8, "%x",       0x1234abcd)
-    TEST("edcb5433",        8, "%x",       -0x1234abcd)
-    TEST("1234ABCD",        8, "%X",       0x1234abcd)
-    TEST("EDCB5433",        8, "%X",       -0x1234abcd)
+    TEST("1024",            4, "%u",       1024u)
+    TEST("4294966272",     10, "%u",       -1024u)
+    TEST("777",             3, "%o",       0777u)
+    TEST("37777777001",    11, "%o",       -0777u)
+    TEST("1234abcd",        8, "%x",       0x1234abcdu)
+    TEST("edcb5433",        8, "%x",       -0x1234abcdu)
+    TEST("1234ABCD",        8, "%X",       0x1234abcdu)
+    TEST("EDCB5433",        8, "%X",       -0x1234abcdu)
     TEST("x",               1, "%c",       'x')
     TEST("%",               1, "%%")
 
@@ -74,14 +74,14 @@ int test_sprintf(void)
     TEST("-1024",           5, "%+d",      -1024)
     TEST("+1024",           5, "%+i",      1024)
     TEST("-1024",           5, "%+i",      -1024)
-    TEST("1024",            4, "%+u",      1024)
-    TEST("4294966272",     10, "%+u",      -1024)
-    TEST("777",             3, "%+o",      0777)
-    TEST("37777777001",    11, "%+o",      -0777)
-    TEST("1234abcd",        8, "%+x",      0x1234abcd)
-    TEST("edcb5433",        8, "%+x",      -0x1234abcd)
-    TEST("1234ABCD",        8, "%+X",      0x1234abcd)
-    TEST("EDCB5433",        8, "%+X",      -0x1234abcd)
+    TEST("1024",            4, "%+u",      1024u)
+    TEST("4294966272",     10, "%+u",      -1024u)
+    TEST("777",             3, "%+o",      0777u)
+    TEST("37777777001",    11, "%+o",      -0777u)
+    TEST("1234abcd",        8, "%+x",      0x1234abcdu)
+    TEST("edcb5433",        8, "%+x",      -0x1234abcdu)
+    TEST("1234ABCD",        8, "%+X",      0x1234abcdu)
+    TEST("EDCB5433",        8, "%+X",      -0x1234abcdu)
     TEST("x",               1, "%+c",      'x')
 
     /* Vorzeichenplatzhalter erzwingen (Flag <space>) */
@@ -90,14 +90,14 @@ int test_sprintf(void)
     TEST("-1024",           5, "% d",      -1024)
     TEST(" 1024",           5, "% i",      1024)
     TEST("-1024",           5, "% i",      -1024)
-    TEST("1024",            4, "% u",      1024)
-    TEST("4294966272",     10, "% u",      -1024)
-    TEST("777",             3, "% o",      0777)
-    TEST("37777777001",    11, "% o",      -0777)
-    TEST("1234abcd",        8, "% x",      0x1234abcd)
-    TEST("edcb5433",        8, "% x",      -0x1234abcd)
-    TEST("1234ABCD",        8, "% X",      0x1234abcd)
-    TEST("EDCB5433",        8, "% X",      -0x1234abcd)
+    TEST("1024",            4, "% u",      1024u)
+    TEST("4294966272",     10, "% u",      -1024u)
+    TEST("777",             3, "% o",      0777u)
+    TEST("37777777001",    11, "% o",      -0777u)
+    TEST("1234abcd",        8, "% x",      0x1234abcdu)
+    TEST("edcb5433",        8, "% x",      -0x1234abcdu)
+    TEST("1234ABCD",        8, "% X",      0x1234abcdu)
+    TEST("EDCB5433",        8, "% X",      -0x1234abcdu)
     TEST("x",               1, "% c",      'x')
 
     /* Flag + hat Vorrang über <space> */
@@ -106,26 +106,26 @@ int test_sprintf(void)
     TEST("-1024",           5, "%+ d",      -1024)
     TEST("+1024",           5, "%+ i",      1024)
     TEST("-1024",           5, "%+ i",      -1024)
-    TEST("1024",            4, "%+ u",      1024)
-    TEST("4294966272",     10, "%+ u",      -1024)
-    TEST("777",             3, "%+ o",      0777)
-    TEST("37777777001",    11, "%+ o",      -0777)
-    TEST("1234abcd",        8, "%+ x",      0x1234abcd)
-    TEST("edcb5433",        8, "%+ x",      -0x1234abcd)
-    TEST("1234ABCD",        8, "%+ X",      0x1234abcd)
-    TEST("EDCB5433",        8, "%+ X",      -0x1234abcd)
+    TEST("1024",            4, "%+ u",      1024u)
+    TEST("4294966272",     10, "%+ u",      -1024u)
+    TEST("777",             3, "%+ o",      0777u)
+    TEST("37777777001",    11, "%+ o",      -0777u)
+    TEST("1234abcd",        8, "%+ x",      0x1234abcdu)
+    TEST("edcb5433",        8, "%+ x",      -0x1234abcdu)
+    TEST("1234ABCD",        8, "%+ X",      0x1234abcdu)
+    TEST("EDCB5433",        8, "%+ X",      -0x1234abcdu)
     TEST("x",               1, "%+ c",      'x')
 
     /* Alternative Form */
-    TEST("0777",            4, "%#o",      0777)
-    TEST("037777777001",   12, "%#o",      -0777)
-    TEST("0x1234abcd",     10, "%#x",      0x1234abcd)
-    TEST("0xedcb5433",     10, "%#x",      -0x1234abcd)
-    TEST("0X1234ABCD",     10, "%#X",      0x1234abcd)
-    TEST("0XEDCB5433",     10, "%#X",      -0x1234abcd)
-    TEST("0",               1, "%#o",      0)
-    TEST("0",               1, "%#x",      0)
-    TEST("0",               1, "%#X",      0)
+    TEST("0777",            4, "%#o",      0777u)
+    TEST("037777777001",   12, "%#o",      -0777u)
+    TEST("0x1234abcd",     10, "%#x",      0x1234abcdu)
+    TEST("0xedcb5433",     10, "%#x",      -0x1234abcdu)
+    TEST("0X1234ABCD",     10, "%#X",      0x1234abcdu)
+    TEST("0XEDCB5433",     10, "%#X",      -0x1234abcdu)
+    TEST("0",               1, "%#o",      0u)
+    TEST("0",               1, "%#x",      0u)
+    TEST("0",               1, "%#X",      0u)
 
     /* Feldbreite: Kleiner als Ausgabe */
     TEST("Hallo heimur",   12, "%1s",      "Hallo heimur")
@@ -133,14 +133,14 @@ int test_sprintf(void)
     TEST("-1024",           5, "%1d",      -1024)
     TEST("1024",            4, "%1i",      1024)
     TEST("-1024",           5, "%1i",      -1024)
-    TEST("1024",            4, "%1u",      1024)
-    TEST("4294966272",     10, "%1u",      -1024)
-    TEST("777",             3, "%1o",      0777)
-    TEST("37777777001",    11, "%1o",      -0777)
-    TEST("1234abcd",        8, "%1x",      0x1234abcd)
-    TEST("edcb5433",        8, "%1x",      -0x1234abcd)
-    TEST("1234ABCD",        8, "%1X",      0x1234abcd)
-    TEST("EDCB5433",        8, "%1X",      -0x1234abcd)
+    TEST("1024",            4, "%1u",      1024u)
+    TEST("4294966272",     10, "%1u",      -1024u)
+    TEST("777",             3, "%1o",      0777u)
+    TEST("37777777001",    11, "%1o",      -0777u)
+    TEST("1234abcd",        8, "%1x",      0x1234abcdu)
+    TEST("edcb5433",        8, "%1x",      -0x1234abcdu)
+    TEST("1234ABCD",        8, "%1X",      0x1234abcdu)
+    TEST("EDCB5433",        8, "%1X",      -0x1234abcdu)
     TEST("x",               1, "%1c",      'x')
 
     /* Feldbreite: Größer als Ausgabe */
@@ -149,14 +149,14 @@ int test_sprintf(void)
     TEST("               -1024",  20, "%20d",      -1024)
     TEST("                1024",  20, "%20i",      1024)
     TEST("               -1024",  20, "%20i",      -1024)
-    TEST("                1024",  20, "%20u",      1024)
-    TEST("          4294966272",  20, "%20u",      -1024)
-    TEST("                 777",  20, "%20o",      0777)
-    TEST("         37777777001",  20, "%20o",      -0777)
-    TEST("            1234abcd",  20, "%20x",      0x1234abcd)
-    TEST("            edcb5433",  20, "%20x",      -0x1234abcd)
-    TEST("            1234ABCD",  20, "%20X",      0x1234abcd)
-    TEST("            EDCB5433",  20, "%20X",      -0x1234abcd)
+    TEST("                1024",  20, "%20u",      1024u)
+    TEST("          4294966272",  20, "%20u",      -1024u)
+    TEST("                 777",  20, "%20o",      0777u)
+    TEST("         37777777001",  20, "%20o",      -0777u)
+    TEST("            1234abcd",  20, "%20x",      0x1234abcdu)
+    TEST("            edcb5433",  20, "%20x",      -0x1234abcdu)
+    TEST("            1234ABCD",  20, "%20X",      0x1234abcdu)
+    TEST("            EDCB5433",  20, "%20X",      -0x1234abcdu)
     TEST("                   x",  20, "%20c",      'x')
 
     /* Feldbreite: Linksbündig */
@@ -165,14 +165,14 @@ int test_sprintf(void)
     TEST("-1024               ",  20, "%-20d",      -1024)
     TEST("1024                ",  20, "%-20i",      1024)
     TEST("-1024               ",  20, "%-20i",      -1024)
-    TEST("1024                ",  20, "%-20u",      1024)
-    TEST("4294966272          ",  20, "%-20u",      -1024)
-    TEST("777                 ",  20, "%-20o",      0777)
-    TEST("37777777001         ",  20, "%-20o",      -0777)
-    TEST("1234abcd            ",  20, "%-20x",      0x1234abcd)
-    TEST("edcb5433            ",  20, "%-20x",      -0x1234abcd)
-    TEST("1234ABCD            ",  20, "%-20X",      0x1234abcd)
-    TEST("EDCB5433            ",  20, "%-20X",      -0x1234abcd)
+    TEST("1024                ",  20, "%-20u",      1024u)
+    TEST("4294966272          ",  20, "%-20u",      -1024u)
+    TEST("777                 ",  20, "%-20o",      0777u)
+    TEST("37777777001         ",  20, "%-20o",      -0777u)
+    TEST("1234abcd            ",  20, "%-20x",      0x1234abcdu)
+    TEST("edcb5433            ",  20, "%-20x",      -0x1234abcdu)
+    TEST("1234ABCD            ",  20, "%-20X",      0x1234abcdu)
+    TEST("EDCB5433            ",  20, "%-20X",      -0x1234abcdu)
     TEST("x                   ",  20, "%-20c",      'x')
 
     /* Feldbreite: Padding mit 0 */
@@ -180,29 +180,29 @@ int test_sprintf(void)
     TEST("-0000000000000001024",  20, "%020d",      -1024)
     TEST("00000000000000001024",  20, "%020i",      1024)
     TEST("-0000000000000001024",  20, "%020i",      -1024)
-    TEST("00000000000000001024",  20, "%020u",      1024)
-    TEST("00000000004294966272",  20, "%020u",      -1024)
-    TEST("00000000000000000777",  20, "%020o",      0777)
-    TEST("00000000037777777001",  20, "%020o",      -0777)
-    TEST("0000000000001234abcd",  20, "%020x",      0x1234abcd)
-    TEST("000000000000edcb5433",  20, "%020x",      -0x1234abcd)
-    TEST("0000000000001234ABCD",  20, "%020X",      0x1234abcd)
-    TEST("000000000000EDCB5433",  20, "%020X",      -0x1234abcd)
+    TEST("00000000000000001024",  20, "%020u",      1024u)
+    TEST("00000000004294966272",  20, "%020u",      -1024u)
+    TEST("00000000000000000777",  20, "%020o",      0777u)
+    TEST("00000000037777777001",  20, "%020o",      -0777u)
+    TEST("0000000000001234abcd",  20, "%020x",      0x1234abcdu)
+    TEST("000000000000edcb5433",  20, "%020x",      -0x1234abcdu)
+    TEST("0000000000001234ABCD",  20, "%020X",      0x1234abcdu)
+    TEST("000000000000EDCB5433",  20, "%020X",      -0x1234abcdu)
 
     /* Feldbreite: Padding und alternative Form */
-    TEST("                0777",  20, "%#20o",      0777)
-    TEST("        037777777001",  20, "%#20o",      -0777)
-    TEST("          0x1234abcd",  20, "%#20x",      0x1234abcd)
-    TEST("          0xedcb5433",  20, "%#20x",      -0x1234abcd)
-    TEST("          0X1234ABCD",  20, "%#20X",      0x1234abcd)
-    TEST("          0XEDCB5433",  20, "%#20X",      -0x1234abcd)
+    TEST("                0777",  20, "%#20o",      0777u)
+    TEST("        037777777001",  20, "%#20o",      -0777u)
+    TEST("          0x1234abcd",  20, "%#20x",      0x1234abcdu)
+    TEST("          0xedcb5433",  20, "%#20x",      -0x1234abcdu)
+    TEST("          0X1234ABCD",  20, "%#20X",      0x1234abcdu)
+    TEST("          0XEDCB5433",  20, "%#20X",      -0x1234abcdu)
 
-    TEST("00000000000000000777",  20, "%#020o",     0777)
-    TEST("00000000037777777001",  20, "%#020o",     -0777)
-    TEST("0x00000000001234abcd",  20, "%#020x",     0x1234abcd)
-    TEST("0x0000000000edcb5433",  20, "%#020x",     -0x1234abcd)
-    TEST("0X00000000001234ABCD",  20, "%#020X",     0x1234abcd)
-    TEST("0X0000000000EDCB5433",  20, "%#020X",     -0x1234abcd)
+    TEST("00000000000000000777",  20, "%#020o",     0777u)
+    TEST("00000000037777777001",  20, "%#020o",     -0777u)
+    TEST("0x00000000001234abcd",  20, "%#020x",     0x1234abcdu)
+    TEST("0x0000000000edcb5433",  20, "%#020x",     -0x1234abcdu)
+    TEST("0X00000000001234ABCD",  20, "%#020X",     0x1234abcdu)
+    TEST("0X0000000000EDCB5433",  20, "%#020X",     -0x1234abcdu)
 
     /* Feldbreite: - hat Vorrang vor 0 */
     TEST("Hallo               ",  20, "%0-20s",      "Hallo")
@@ -210,14 +210,14 @@ int test_sprintf(void)
     TEST("-1024               ",  20, "%0-20d",      -1024)
     TEST("1024                ",  20, "%0-20i",      1024)
     TEST("-1024               ",  20, "%0-20i",      -1024)
-    TEST("1024                ",  20, "%0-20u",      1024)
-    TEST("4294966272          ",  20, "%0-20u",      -1024)
-    TEST("777                 ",  20, "%-020o",      0777)
-    TEST("37777777001         ",  20, "%-020o",      -0777)
-    TEST("1234abcd            ",  20, "%-020x",      0x1234abcd)
-    TEST("edcb5433            ",  20, "%-020x",      -0x1234abcd)
-    TEST("1234ABCD            ",  20, "%-020X",      0x1234abcd)
-    TEST("EDCB5433            ",  20, "%-020X",      -0x1234abcd)
+    TEST("1024                ",  20, "%0-20u",      1024u)
+    TEST("4294966272          ",  20, "%0-20u",      -1024u)
+    TEST("777                 ",  20, "%-020o",      0777u)
+    TEST("37777777001         ",  20, "%-020o",      -0777u)
+    TEST("1234abcd            ",  20, "%-020x",      0x1234abcdu)
+    TEST("edcb5433            ",  20, "%-020x",      -0x1234abcdu)
+    TEST("1234ABCD            ",  20, "%-020X",      0x1234abcdu)
+    TEST("EDCB5433            ",  20, "%-020X",      -0x1234abcdu)
     TEST("x                   ",  20, "%-020c",      'x')
 
     /* Feldbreite: Aus Parameter */
@@ -226,14 +226,14 @@ int test_sprintf(void)
     TEST("               -1024",  20, "%*d",      20, -1024)
     TEST("                1024",  20, "%*i",      20, 1024)
     TEST("               -1024",  20, "%*i",      20, -1024)
-    TEST("                1024",  20, "%*u",      20, 1024)
-    TEST("          4294966272",  20, "%*u",      20, -1024)
-    TEST("                 777",  20, "%*o",      20, 0777)
-    TEST("         37777777001",  20, "%*o",      20, -0777)
-    TEST("            1234abcd",  20, "%*x",      20, 0x1234abcd)
-    TEST("            edcb5433",  20, "%*x",      20, -0x1234abcd)
-    TEST("            1234ABCD",  20, "%*X",      20, 0x1234abcd)
-    TEST("            EDCB5433",  20, "%*X",      20, -0x1234abcd)
+    TEST("                1024",  20, "%*u",      20, 1024u)
+    TEST("          4294966272",  20, "%*u",      20, -1024u)
+    TEST("                 777",  20, "%*o",      20, 0777u)
+    TEST("         37777777001",  20, "%*o",      20, -0777u)
+    TEST("            1234abcd",  20, "%*x",      20, 0x1234abcdu)
+    TEST("            edcb5433",  20, "%*x",      20, -0x1234abcdu)
+    TEST("            1234ABCD",  20, "%*X",      20, 0x1234abcdu)
+    TEST("            EDCB5433",  20, "%*X",      20, -0x1234abcdu)
     TEST("                   x",  20, "%*c",      20, 'x')
 
     /* Präzision / Mindestanzahl von Ziffern */
@@ -242,14 +242,14 @@ int test_sprintf(void)
     TEST("-00000000000000001024",  21, "%.20d",      -1024)
     TEST("00000000000000001024",   20, "%.20i",      1024)
     TEST("-00000000000000001024",  21, "%.20i",      -1024)
-    TEST("00000000000000001024",   20, "%.20u",      1024)
-    TEST("00000000004294966272",   20, "%.20u",      -1024)
-    TEST("00000000000000000777",   20, "%.20o",      0777)
-    TEST("00000000037777777001",   20, "%.20o",      -0777)
-    TEST("0000000000001234abcd",   20, "%.20x",      0x1234abcd)
-    TEST("000000000000edcb5433",   20, "%.20x",      -0x1234abcd)
-    TEST("0000000000001234ABCD",   20, "%.20X",      0x1234abcd)
-    TEST("000000000000EDCB5433",   20, "%.20X",      -0x1234abcd)
+    TEST("00000000000000001024",   20, "%.20u",      1024u)
+    TEST("00000000004294966272",   20, "%.20u",      -1024u)
+    TEST("00000000000000000777",   20, "%.20o",      0777u)
+    TEST("00000000037777777001",   20, "%.20o",      -0777u)
+    TEST("0000000000001234abcd",   20, "%.20x",      0x1234abcdu)
+    TEST("000000000000edcb5433",   20, "%.20x",      -0x1234abcdu)
+    TEST("0000000000001234ABCD",   20, "%.20X",      0x1234abcdu)
+    TEST("000000000000EDCB5433",   20, "%.20X",      -0x1234abcdu)
 
     /* Feldbreite und Präzision */
     TEST("               Hallo",   20, "%20.5s",     "Hallo heimur")
@@ -257,14 +257,14 @@ int test_sprintf(void)
     TEST("              -01024",   20, "%20.5d",      -1024)
     TEST("               01024",   20, "%20.5i",      1024)
     TEST("              -01024",   20, "%20.5i",      -1024)
-    TEST("               01024",   20, "%20.5u",      1024)
-    TEST("          4294966272",   20, "%20.5u",      -1024)
-    TEST("               00777",   20, "%20.5o",      0777)
-    TEST("         37777777001",   20, "%20.5o",      -0777)
-    TEST("            1234abcd",   20, "%20.5x",      0x1234abcd)
-    TEST("          00edcb5433",   20, "%20.10x",     -0x1234abcd)
-    TEST("            1234ABCD",   20, "%20.5X",      0x1234abcd)
-    TEST("          00EDCB5433",   20, "%20.10X",     -0x1234abcd)
+    TEST("               01024",   20, "%20.5u",      1024u)
+    TEST("          4294966272",   20, "%20.5u",      -1024u)
+    TEST("               00777",   20, "%20.5o",      0777u)
+    TEST("         37777777001",   20, "%20.5o",      -0777u)
+    TEST("            1234abcd",   20, "%20.5x",      0x1234abcdu)
+    TEST("          00edcb5433",   20, "%20.10x",     -0x1234abcdu)
+    TEST("            1234ABCD",   20, "%20.5X",      0x1234abcdu)
+    TEST("          00EDCB5433",   20, "%20.10X",     -0x1234abcdu)
 
     /* Präzision: 0 wird ignoriert */
     TEST("               Hallo",   20, "%020.5s",    "Hallo heimur")
@@ -272,14 +272,14 @@ int test_sprintf(void)
     TEST("              -01024",   20, "%020.5d",     -1024)
     TEST("               01024",   20, "%020.5i",     1024)
     TEST("              -01024",   20, "%020.5i",     -1024)
-    TEST("               01024",   20, "%020.5u",     1024)
-    TEST("          4294966272",   20, "%020.5u",     -1024)
-    TEST("               00777",   20, "%020.5o",     0777)
-    TEST("         37777777001",   20, "%020.5o",     -0777)
-    TEST("            1234abcd",   20, "%020.5x",     0x1234abcd)
-    TEST("          00edcb5433",   20, "%020.10x",    -0x1234abcd)
-    TEST("            1234ABCD",   20, "%020.5X",     0x1234abcd)
-    TEST("          00EDCB5433",   20, "%020.10X",    -0x1234abcd)
+    TEST("               01024",   20, "%020.5u",     1024u)
+    TEST("          4294966272",   20, "%020.5u",     -1024u)
+    TEST("               00777",   20, "%020.5o",     0777u)
+    TEST("         37777777001",   20, "%020.5o",     -0777u)
+    TEST("            1234abcd",   20, "%020.5x",     0x1234abcdu)
+    TEST("          00edcb5433",   20, "%020.10x",    -0x1234abcdu)
+    TEST("            1234ABCD",   20, "%020.5X",     0x1234abcdu)
+    TEST("          00EDCB5433",   20, "%020.10X",    -0x1234abcdu)
 
     /* Präzision 0 */
     TEST("",                        0, "%.0s",        "Hallo heimur")
@@ -292,18 +292,18 @@ int test_sprintf(void)
     TEST("                1024",   20, "%20.0i",      1024)
     TEST("               -1024",   20, "%20.i",       -1024)
     TEST("                    ",   20, "%20.i",       0)
-    TEST("                1024",   20, "%20.u",       1024)
-    TEST("          4294966272",   20, "%20.0u",      -1024)
-    TEST("                    ",   20, "%20.u",       0)
-    TEST("                 777",   20, "%20.o",       0777)
-    TEST("         37777777001",   20, "%20.0o",      -0777)
-    TEST("                    ",   20, "%20.o",       0)
-    TEST("            1234abcd",   20, "%20.x",       0x1234abcd)
-    TEST("            edcb5433",   20, "%20.0x",      -0x1234abcd)
-    TEST("                    ",   20, "%20.x",       0)
-    TEST("            1234ABCD",   20, "%20.X",       0x1234abcd)
-    TEST("            EDCB5433",   20, "%20.0X",      -0x1234abcd)
-    TEST("                    ",   20, "%20.X",       0)
+    TEST("                1024",   20, "%20.u",       1024u)
+    TEST("          4294966272",   20, "%20.0u",      -1024u)
+    TEST("                    ",   20, "%20.u",       0u)
+    TEST("                 777",   20, "%20.o",       0777u)
+    TEST("         37777777001",   20, "%20.0o",      -0777u)
+    TEST("                    ",   20, "%20.o",       0u)
+    TEST("            1234abcd",   20, "%20.x",       0x1234abcdu)
+    TEST("            edcb5433",   20, "%20.0x",      -0x1234abcdu)
+    TEST("                    ",   20, "%20.x",       0u)
+    TEST("            1234ABCD",   20, "%20.X",       0x1234abcdu)
+    TEST("            EDCB5433",   20, "%20.0X",      -0x1234abcdu)
+    TEST("                    ",   20, "%20.X",       0u)
 
     /* Negative Präzision wird ignoriert */
     /* XXX glibc tut nicht, was ich erwartet habe, vorerst deaktiviert... */
@@ -313,14 +313,14 @@ int test_sprintf(void)
     TEST("-1024",           5, "%.-42d",       -1024)
     TEST("1024",            4, "%.-42i",       1024)
     TEST("-1024",           5, "%.-42i",       -1024)
-    TEST("1024",            4, "%.-42u",       1024)
-    TEST("4294966272",     10, "%.-42u",       -1024)
-    TEST("777",             3, "%.-42o",       0777)
-    TEST("37777777001",    11, "%.-42o",       -0777)
-    TEST("1234abcd",        8, "%.-42x",       0x1234abcd)
-    TEST("edcb5433",        8, "%.-42x",       -0x1234abcd)
-    TEST("1234ABCD",        8, "%.-42X",       0x1234abcd)
-    TEST("EDCB5433",        8, "%.-42X",       -0x1234abcd)
+    TEST("1024",            4, "%.-42u",       1024u)
+    TEST("4294966272",     10, "%.-42u",       -1024u)
+    TEST("777",             3, "%.-42o",       0777u)
+    TEST("37777777001",    11, "%.-42o",       -0777u)
+    TEST("1234abcd",        8, "%.-42x",       0x1234abcdu)
+    TEST("edcb5433",        8, "%.-42x",       -0x1234abcdu)
+    TEST("1234ABCD",        8, "%.-42X",       0x1234abcdu)
+    TEST("EDCB5433",        8, "%.-42X",       -0x1234abcdu)
 #endif
 
     /*
@@ -333,14 +333,14 @@ int test_sprintf(void)
     TEST("-01024              ",   20, "% -0+*.*d",    20,  5,  -1024)
     TEST("+01024              ",   20, "% -0+*.*i",    20,  5,  1024)
     TEST("-01024              ",   20, "% 0-+*.*i",    20,  5,  -1024)
-    TEST("01024               ",   20, "% 0-+*.*u",    20,  5,  1024)
-    TEST("4294966272          ",   20, "% 0-+*.*u",    20,  5,  -1024)
-    TEST("00777               ",   20, "%+ -0*.*o",    20,  5,  0777)
-    TEST("37777777001         ",   20, "%+ -0*.*o",    20,  5,  -0777)
-    TEST("1234abcd            ",   20, "%+ -0*.*x",    20,  5,  0x1234abcd)
-    TEST("00edcb5433          ",   20, "%+ -0*.*x",    20, 10,  -0x1234abcd)
-    TEST("1234ABCD            ",   20, "% -+0*.*X",    20,  5,  0x1234abcd)
-    TEST("00EDCB5433          ",   20, "% -+0*.*X",    20, 10,  -0x1234abcd)
+    TEST("01024               ",   20, "% 0-+*.*u",    20,  5,  1024u)
+    TEST("4294966272          ",   20, "% 0-+*.*u",    20,  5,  -1024u)
+    TEST("00777               ",   20, "%+ -0*.*o",    20,  5,  0777u)
+    TEST("37777777001         ",   20, "%+ -0*.*o",    20,  5,  -0777u)
+    TEST("1234abcd            ",   20, "%+ -0*.*x",    20,  5,  0x1234abcdu)
+    TEST("00edcb5433          ",   20, "%+ -0*.*x",    20, 10,  -0x1234abcdu)
+    TEST("1234ABCD            ",   20, "% -+0*.*X",    20,  5,  0x1234abcdu)
+    TEST("00EDCB5433          ",   20, "% -+0*.*X",    20, 10,  -0x1234abcdu)
 
     if (failed == 0) {
         printf("* PASS sprintf\n");
-- 
1.7.8.1