diff options
Diffstat (limited to 'snprintf.c')
-rw-r--r-- | snprintf.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -95,6 +95,10 @@ int test_snprintf(void) int err=0; char b[500], *s; + TEST(i, snprintf(0, 0, "%d", 123456), 6, "length returned %d != %d"); + TEST(i, snprintf(0, 0, "%.4s", "hello"), 4, "length returned %d != %d"); + TEST(i, snprintf(b, 0, "%.0s", "goodbye"), 0, "length returned %d != %d"); + strcpy(b, "xxxxxxxx"); TEST(i, snprintf(b, 4, "%d", 123456), 6, "length returned %d != %d"); TEST_S(b, "123", "incorrect output"); |