# HG changeset patch # User Matti Hamalainen # Date 1456228332 -7200 # Node ID b90173719330865f66bfe1f281e987f33c2e6388 # Parent a705d21ca25bd3ccdb889421691b9ab2b3e80fe2 Add more tests (some of which will fail for now due to unimplemented features). diff -r a705d21ca25b -r b90173719330 tests.c --- a/tests.c Tue Feb 23 13:00:20 2016 +0200 +++ b/tests.c Tue Feb 23 13:52:12 2016 +0200 @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) { - size_t i1, i2, i3; + size_t i1, i2, i3, i4; char buf[64], buf2[64]; // @@ -299,7 +299,8 @@ // // Test series #1 // - char *i_fmts[] = { "%", "%05", "%5", "%-5", "%.5", "%5.5", "%05.5", "% ", "% 3", "% 3.2", "%+3", }; + char *i_fmts[] = { "", "05", "5", "5", ".5", "5.5", "05.5", "3", "3.2", "3", }; + char *i_mods[] = { "", "-", "+", "#", }; char *i_types[] = { "d", "x", "X", "o", }; if (test_set_start("printf() integer")) { @@ -309,10 +310,11 @@ { snprintf(buf, sizeof(buf), "%d", i_vals[i1]); + for (i4 = 0; i4 < NCOUNT(i_mods); i4++) for (i3 = 0; i3 < NCOUNT(i_types); i3++) for (i2 = 0; i2 < NCOUNT(i_fmts); i2++) { - snprintf(buf2, sizeof(buf2), "%s%s", i_fmts[i2], i_types[i3]); + snprintf(buf2, sizeof(buf2), "%%%s%s%s", i_mods[i4], i_fmts[i2], i_types[i3]); test_snprintf(buf, buf2, i_vals[i1]); } }