aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2018-04-18 17:08:31 +0200
committerMarco Paland <marco@paland.com>2018-04-18 17:08:31 +0200
commitdd8432003c9b4f352c053ef137c012d8ed50faf5 (patch)
treefb6b786b391c98bec3b61573ba56e3fd2f3bf19a /test
parentca6e7e5291986b95e0fad98a0a9018c8c8ce1fe1 (diff)
downloadprintf-dd8432003c9b4f352c053ef137c012d8ed50faf5.tar.gz
printf-dd8432003c9b4f352c053ef137c012d8ed50faf5.tar.bz2
printf-dd8432003c9b4f352c053ef137c012d8ed50faf5.zip
fix(printf): fixed conversion buffer handling
Added according test cases
Diffstat (limited to 'test')
-rw-r--r--test/test_suite.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index 0a51e09..a8de789 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -817,6 +817,12 @@ TEST_CASE("length", "[]" ) {
test::sprintf(buffer, "%20.x", 305441741);
REQUIRE(!strcmp(buffer, " 1234abcd"));
+ test::sprintf(buffer, "%50.x", 305441741);
+ REQUIRE(!strcmp(buffer, " 1234abcd"));
+
+ test::sprintf(buffer, "%50.x%10.u", 305441741, 12345);
+ REQUIRE(!strcmp(buffer, " 1234abcd 12345"));
+
test::sprintf(buffer, "%20.0x", 3989525555U);
REQUIRE(!strcmp(buffer, " edcb5433"));