Index: tests/OFList/OFList.m ================================================================== --- tests/OFList/OFList.m +++ tests/OFList/OFList.m @@ -14,21 +14,27 @@ #import #import #import "OFString.h" #import "OFList.h" + +#ifndef _WIN32 +#define ZD "%zd" +#else +#define ZD "%u" +#endif #define NUM_TESTS 5 #define SUCCESS \ { \ - printf("\r\033[1;%dmTests successful: %zd/%d\033[0m", \ + printf("\r\033[1;%dmTests successful: " ZD "/%d\033[0m", \ (i == NUM_TESTS - 1 ? 32 : 33), i + 1, NUM_TESTS); \ fflush(stdout); \ } #define FAIL \ { \ - printf("\r\033[K\033[1;31mTest %zd/%d failed!\033[m\n", \ + printf("\r\033[K\033[1;31mTest " ZD "/%d failed!\033[m\n", \ i + 1, NUM_TESTS); \ return 1; \ } #define CHECK(cond) \ if (cond) \ Index: tests/OFString/OFString.m ================================================================== --- tests/OFString/OFString.m +++ tests/OFString/OFString.m @@ -14,18 +14,24 @@ #import #import #import "OFString.h" #import "OFExceptions.h" + +#ifndef _WIN32 +#define ZD "%zd" +#else +#define ZD "%u" +#endif #define NUM_TESTS 10 #define SUCCESS \ - printf("\r\033[1;%dmTests successful: %zd/%d\033[0m", \ + printf("\r\033[1;%dmTests successful: " ZD "/%d\033[0m", \ (i == NUM_TESTS - 1 ? 32 : 33), i + 1, NUM_TESTS); \ fflush(stdout); #define FAIL \ - printf("\r\033[K\033[1;31mTest %zd/%d failed!\033[m\n", \ + printf("\r\033[K\033[1;31mTest " ZD "/%d failed!\033[m\n", \ i + 1, NUM_TESTS); \ return 1; #define CHECK(cond) \ if (cond) { \ SUCCESS \ Index: tests/OFXMLFactory/OFXMLFactory.m ================================================================== --- tests/OFXMLFactory/OFXMLFactory.m +++ tests/OFXMLFactory/OFXMLFactory.m @@ -16,24 +16,30 @@ #import #import "OFXMLFactory.h" #define NUM_TESTS 10 + +#ifndef _WIN32 +#define ZD "zd" +#else +#define ZD "u" +#endif static size_t i; inline void check_result(char *result, const char *should) { i++; if (!strcmp(result, should)) { - printf("\r\033[1;%dmTests successful: %2zd/%d\033[0m", + printf("\r\033[1;%dmTests successful: %2" ZD "/%d\033[0m", (i == NUM_TESTS ? 32 : 33), i, NUM_TESTS); fflush(stdout); } else { - printf("\r\033[K\033[1;31mTest %zd/%d failed!\033[0m\n", + printf("\r\033[K\033[1;31mTest %" ZD "/%d failed!\033[0m\n", i, NUM_TESTS); printf("%s is NOT expected result!\n", result); exit(1); }