Index: tests/OFList/OFList.m ================================================================== --- tests/OFList/OFList.m +++ tests/OFList/OFList.m @@ -7,13 +7,13 @@ * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ -#import -#import +#define _ISOC99_SOURCE #import +#import #import "OFString.h" #import "OFList.h" /* TODO: Do real checks */ @@ -37,29 +37,29 @@ [list addNew: [OFString newFromWideCString: strings[1]]]; [list addNew: [OFString newFromWideCString: strings[2]]]; for (iter = [list first], i = 0; iter != nil; iter = [iter next], i++) if (!wcscmp([(OFString*)[iter data] wideCString], strings[i])) - printf("Element %zu is expected element. GOOD!\n", i); + wprintf(L"Element %zu is expected element. GOOD!\n", i); else { - printf("Element %zu is not expected element!\n", i); + wprintf(L"Element %zu is not expected element!\n", i); return 1; } if (!wcscmp([(OFString*)[[list first] data] wideCString], strings[0])) - puts("First element is expected element. GOOD!"); + wprintf(L"First element is expected element. GOOD!\n"); else { - puts("First element is not expected element!"); + wprintf(L"First element is not expected element!\n"); return 1; } if (!wcscmp([(OFString*)[[list last] data] wideCString], strings[2])) - puts("Last element is expected element. GOOD!"); + wprintf(L"Last element is expected element. GOOD!\n"); else { - puts("Last element is not expected element!"); + wprintf(L"Last element is not expected element!\n"); return 1; } [list freeIncludingData]; return 0; } Index: tests/OFXMLFactory/OFXMLFactory.m ================================================================== --- tests/OFXMLFactory/OFXMLFactory.m +++ tests/OFXMLFactory/OFXMLFactory.m @@ -7,24 +7,26 @@ * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ -#import +#define _ISOC99_SOURCE #import #import #import #import "OFXMLFactory.h" inline void check_result(char *result, const char *should) { + /* Use wprintf here so we don't mix printf and wprintf! */ + if (!strcmp(result, should)) - printf("%s is expected result\n", result); + wprintf(L"%s is expected result\n", result); else { - printf("%s is NOT expected result!\n", result); + wprintf(L"%s is NOT expected result!\n", result); exit(1); } free(result); } @@ -222,13 +224,13 @@ { test_escape(); test_create_stanza(); test_concat(); - puts("== Now testing with wide C strings =="); + wprintf(L"== Now testing with wide C strings ==\n"); test_escape_wide(); test_create_stanza_wide(); test_concat_wide(); return 0; }