diff options
author | dzwdz | 2022-08-05 15:30:12 +0200 |
---|---|---|
committer | dzwdz | 2022-08-05 15:30:12 +0200 |
commit | 0f3c70649a3d8035b0c0f9658705505948b2c60a (patch) | |
tree | 1e6f1240d7660e0683081112980ac9ccfc5d6d37 /src/user | |
parent | f6b139d55e7fa9ec5498eeadfdf3fdd5d0a927f4 (diff) |
shared/printf: implement %d
Diffstat (limited to 'src/user')
-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) { |