Module: wine Branch: master Commit: 9299c4985e117084779c7e3e4ee2a3aff1873b69 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9299c4985e117084779c7e3e4e...
Author: Francois Gouget fgouget@free.fr Date: Sat Jan 6 19:32:56 2007 +0100
kernel32/tests: Replace some '#if 0's with 'if (0)'s.
Fix the code so it compiles without warnings.
---
dlls/kernel32/tests/console.c | 5 ++--- dlls/kernel32/tests/file.c | 14 ++++++++------ dlls/kernel32/tests/path.c | 13 +++++-------- 3 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 3bcb872..abd42bd 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -532,9 +532,8 @@ static void testCtrlHandler(void) mch_event = CreateEventA(NULL, TRUE, FALSE, NULL); mch_count = 0; ok(GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0), "Couldn't send ctrl-c event\n"); -#if 0 /* FIXME: it isn't synchronous on wine but it can still happen before we test */ - todo_wine ok(mch_count == 1, "Event isn't synchronous\n"); -#endif + /* FIXME: it isn't synchronous on wine but it can still happen before we test */ + if (0) ok(mch_count == 1, "Event isn't synchronous\n"); ok(WaitForSingleObject(mch_event, 3000) == WAIT_OBJECT_0, "event sending didn't work\n"); CloseHandle(mch_event);
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 5b86d3c..7eecec6 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -693,12 +693,14 @@ static void test_CreateFileW(void) ret = DeleteFileW(filename); ok(ret, "DeleteFileW: error %d\n", GetLastError());
-#if 0 /* this test crashes on NT4.0 */ - hFile = CreateFileW(NULL, GENERIC_READ, 0, NULL, - CREATE_NEW, FILE_FLAG_RANDOM_ACCESS, 0); - ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, - "CreateFileW(NULL) returned ret=%p error=%ld\n",hFile,GetLastError()); -#endif + if (0) + { + /* this crashes on NT4.0 */ + hFile = CreateFileW(NULL, GENERIC_READ, 0, NULL, + CREATE_NEW, FILE_FLAG_RANDOM_ACCESS, 0); + ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, + "CreateFileW(NULL) returned ret=%p error=%u\n",hFile,GetLastError()); + }
hFile = CreateFileW(emptyW, GENERIC_READ, 0, NULL, CREATE_NEW, FILE_FLAG_RANDOM_ACCESS, 0); diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c index 25f5c1b..9212165 100644 --- a/dlls/kernel32/tests/path.c +++ b/dlls/kernel32/tests/path.c @@ -964,10 +964,9 @@ static void test_GetSystemDirectory(void ok(res > 0, "returned %d with %d (expected '>0')\n", res, GetLastError());
total = res; -#if 0 - /* this test crash on XP */ - res = GetSystemDirectory(NULL, total); -#endif + + /* this crashes on XP */ + if (0) res = GetSystemDirectory(NULL, total);
SetLastError(0xdeadbeef); res = GetSystemDirectory(NULL, total-1); @@ -1024,10 +1023,8 @@ static void test_GetWindowsDirectory(voi ok(res > 0, "returned %d with %d (expected '>0')\n", res, GetLastError());
total = res; -#if 0 - /* this test crash on XP */ - res = GetWindowsDirectory(NULL, total); -#endif + /* this crashes on XP */ + if (0) res = GetWindowsDirectory(NULL, total);
SetLastError(0xdeadbeef); res = GetWindowsDirectory(NULL, total-1);