diff options
Diffstat (limited to 'src/user/app/tests/shared/printf.c')
-rw-r--r-- | src/user/app/tests/shared/printf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/user/app/tests/shared/printf.c b/src/user/app/tests/shared/printf.c index 04175db..4e5ffb8 100644 --- a/src/user/app/tests/shared/printf.c +++ b/src/user/app/tests/shared/printf.c @@ -26,8 +26,13 @@ static void test_printf(void) { snprintf(buf, sizeof buf, "%05u %05u", 1234, 56789); test(!strcmp(buf, "01234 56789")); - snprintf(buf, sizeof buf, "%u %x", 0, 0); - test(!strcmp(buf, "0 0")); + snprintf(buf, sizeof buf, "%5d %5d", 123, 4567); + test(!strcmp(buf, " 123 4567")); + snprintf(buf, sizeof buf, "%5d %5d", -123, -4567); + test(!strcmp(buf, " -123 -4567")); + + snprintf(buf, sizeof buf, "%u %d %x", 0, 0, 0); + test(!strcmp(buf, "0 0 0")); } void r_s_printf(void) { |