aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2017-11-21 14:47:13 +0100
committerMarco Paland <marco@paland.com>2017-11-21 14:47:13 +0100
commit7158a6f50f60008d7b475155f57120113c85cf69 (patch)
tree0113fde644b50a0ef9192e3d84fef6c4d1a0f479 /test
parent9b7cc4837c77caa242e5b06ff29117ae874c6785 (diff)
downloadprintf-7158a6f50f60008d7b475155f57120113c85cf69.tar.gz
printf-7158a6f50f60008d7b475155f57120113c85cf69.tar.bz2
printf-7158a6f50f60008d7b475155f57120113c85cf69.zip
Added pointer testcase
Diffstat (limited to 'test')
-rw-r--r--test/test_suite.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index 9e186aa..910ed91 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -976,6 +976,14 @@ TEST_CASE("pointer", "[]" ) {
else {
REQUIRE(!strcmp(buffer, "0000000012345678"));
}
+
+ test::sprintf(buffer, "%p", (void*)0xFFFFFFFFLU);
+ if (sizeof(void*) == 4U) {
+ REQUIRE(!strcmp(buffer, "FFFFFFFF"));
+ }
+ else {
+ REQUIRE(!strcmp(buffer, "00000000FFFFFFFF"));
+ }
}