diff options
author | Marco Paland <marco@paland.com> | 2018-04-17 17:58:04 +0200 |
---|---|---|
committer | Marco Paland <marco@paland.com> | 2018-04-17 17:58:04 +0200 |
commit | 281e44d53b4506b3e0e737f93af48d0c1ea5ac3e (patch) | |
tree | a672a225e5c81fa611972257ffe51b3d13d85cd0 /test | |
parent | 53cde39d6bc94dda8d6c6d078665d4a5f5e964ae (diff) | |
download | printf-281e44d53b4506b3e0e737f93af48d0c1ea5ac3e.tar.gz printf-281e44d53b4506b3e0e737f93af48d0c1ea5ac3e.tar.bz2 printf-281e44d53b4506b3e0e737f93af48d0c1ea5ac3e.zip |
test(test_suite): added 'z' test cases
Diffstat (limited to 'test')
-rw-r--r-- | test/test_suite.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp index e241195..0a51e09 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////////
// \author (c) Marco Paland (info@paland.com)
-// 2017, PALANDesign Hannover, Germany
+// 2017-2018, PALANDesign Hannover, Germany
//
// \license The MIT License (MIT)
//
@@ -923,6 +923,21 @@ TEST_CASE("types", "[]" ) { test::sprintf(buffer, "%llu", 18446744073709551615LLU);
REQUIRE(!strcmp(buffer, "18446744073709551615"));
+ test::sprintf(buffer, "%zu", 2147483647UL);
+ REQUIRE(!strcmp(buffer, "2147483647"));
+
+ test::sprintf(buffer, "%zd", 2147483647UL);
+ REQUIRE(!strcmp(buffer, "2147483647"));
+
+ if (sizeof(size_t) == sizeof(long)) {
+ test::sprintf(buffer, "%zi", -2147483647L);
+ REQUIRE(!strcmp(buffer, "-2147483647"));
+ }
+ else {
+ test::sprintf(buffer, "%zi", -2147483647LL);
+ REQUIRE(!strcmp(buffer, "-2147483647"));
+ }
+
test::sprintf(buffer, "%b", 60000);
REQUIRE(!strcmp(buffer, "1110101001100000"));
|