aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2018-05-11 12:49:41 +0200
committerMarco Paland <marco@paland.com>2018-05-11 12:49:41 +0200
commitbb5a8af50748b8846ce6d29063ef0747ca4cff86 (patch)
tree55ec59e64b0ad41237174732fa6668599ae20302 /test
parent8609d7628583d7ee0d8e6447a4ad3d249b9b6434 (diff)
downloadprintf-bb5a8af50748b8846ce6d29063ef0747ca4cff86.tar.gz
printf-bb5a8af50748b8846ce6d29063ef0747ca4cff86.tar.bz2
printf-bb5a8af50748b8846ce6d29063ef0747ca4cff86.zip
feat(printf): added support for %h, %hh, %j and %t length modifiers
- Renamed compiler switches - Minor cleanup Closes #12
Diffstat (limited to 'test')
-rw-r--r--test/test_suite.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index 8ee90a3..21eb13f 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -994,6 +994,18 @@ TEST_CASE("types", "[]" ) {
test::sprintf(buffer, "%s", "A Test");
REQUIRE(!strcmp(buffer, "A Test"));
+
+ test::sprintf(buffer, "%hhu", 0xFFFFUL);
+ REQUIRE(!strcmp(buffer, "255"));
+
+ test::sprintf(buffer, "%hu", 0x123456UL);
+ REQUIRE(!strcmp(buffer, "13398"));
+
+ test::sprintf(buffer, "%s%hhi %hu", "Test", 10000, 0xFFFFFFFF);
+ REQUIRE(!strcmp(buffer, "Test16 65535"));
+
+ test::sprintf(buffer, "%tx", &buffer[10] - &buffer[0]);
+ REQUIRE(!strcmp(buffer, "a"));
}