diff options
author | Marco Paland <marco@paland.com> | 2017-11-22 01:30:35 +0100 |
---|---|---|
committer | Marco Paland <marco@paland.com> | 2017-11-22 01:30:35 +0100 |
commit | c355eaa2b0bc0652b125976632cf12f29b5eb298 (patch) | |
tree | 4b8934b019be4691c4c68f73d6bc6fcc0ca77250 /test | |
parent | 002234f2092db7c0b9093f43d09ce2e4a2d52de2 (diff) | |
download | printf-c355eaa2b0bc0652b125976632cf12f29b5eb298.tar.gz printf-c355eaa2b0bc0652b125976632cf12f29b5eb298.tar.bz2 printf-c355eaa2b0bc0652b125976632cf12f29b5eb298.zip |
Fixed 64 bit pointer casting
Diffstat (limited to 'test')
-rw-r--r-- | test/test_suite.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp index 910ed91..568c2a1 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -977,11 +977,12 @@ TEST_CASE("pointer", "[]" ) { REQUIRE(!strcmp(buffer, "0000000012345678"));
}
- test::sprintf(buffer, "%p", (void*)0xFFFFFFFFLU);
- if (sizeof(void*) == 4U) {
+ if (sizeof(void*) == sizeof(long)) {
+ test::sprintf(buffer, "%p", (void*)(long)0xFFFFFFFFU);
REQUIRE(!strcmp(buffer, "FFFFFFFF"));
}
else {
+ test::sprintf(buffer, "%p", (void*)(unsigned long long)0xFFFFFFFFU);
REQUIRE(!strcmp(buffer, "00000000FFFFFFFF"));
}
}
|