aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2018-04-20 00:20:24 +0200
committerMarco Paland <marco@paland.com>2018-04-20 00:20:24 +0200
commit5a1780b72b08ff823b7685289ab55f6164b59573 (patch)
treeecf6d3dbb77d6a5ff51b298521768733fb736c8f
parent8db261eed610d9e60dbc0eb67d7d5eba54a419ad (diff)
downloadprintf-5a1780b72b08ff823b7685289ab55f6164b59573.tar.gz
printf-5a1780b72b08ff823b7685289ab55f6164b59573.tar.bz2
printf-5a1780b72b08ff823b7685289ab55f6164b59573.zip
fix(test_suite): fixed test cases
-rw-r--r--test/test_suite.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index e152ac7..d990309 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -998,12 +998,12 @@ TEST_CASE("pointer", "[]" ) {
REQUIRE(!strcmp(buffer, "0000000012345678"));
}
- if (sizeof(uintptr_t) == sizeof(long long)) {
- test::sprintf(buffer, "%p", (void*)(unsigned long long)0xFFFFFFFFU);
+ if (sizeof(uintptr_t) == sizeof(uint64_t)) {
+ test::sprintf(buffer, "%p", (void*)(uintptr_t)0xFFFFFFFFU);
REQUIRE(!strcmp(buffer, "00000000FFFFFFFF"));
}
else {
- test::sprintf(buffer, "%p", (void*)(unsigned long)0xFFFFFFFFU);
+ test::sprintf(buffer, "%p", (void*)(uintptr_t)0xFFFFFFFFU);
REQUIRE(!strcmp(buffer, "FFFFFFFF"));
}
}
@@ -1024,9 +1024,9 @@ TEST_CASE("buffer length", "[]" ) {
// formatted length, this should return '4',
// but this feature is not implemented, returning 0
ret = test::snprintf(nullptr, 10, "%s", "Test");
- REQUIRE(ret == 0);
+ REQUIRE(ret == -1);
ret = test::snprintf(nullptr, 0, "%s", "Test");
- REQUIRE(ret == 0);
+ REQUIRE(ret == -1);
buffer[0] = (char)0xA5;
ret = test::snprintf(buffer, 0, "%s", "Test");