Module: wine Branch: master Commit: eca3d7487715d92dc43c841d8bb8a6f9522bc4cc URL: http://source.winehq.org/git/wine.git/?a=commit;h=eca3d7487715d92dc43c841d8b...
Author: Paul Vriens Paul.Vriens.Wine@gmail.com Date: Wed Jun 3 21:56:10 2009 +0200
kernel32/tests: Skip WritePrivateProfileString tests on Win9x/WinME.
---
dlls/kernel32/tests/profile.c | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c index fbf5d24..b9a71d3 100644 --- a/dlls/kernel32/tests/profile.c +++ b/dlls/kernel32/tests/profile.c @@ -822,18 +822,12 @@ static void test_GetPrivateProfileString(const char *content, const char *descri DeleteFileA(filename); }
-static DWORD timeout = 0; - static BOOL check_binary_file_data(LPCSTR path, const VOID *data, DWORD size) { HANDLE file; CHAR buf[MAX_PATH]; BOOL ret;
- /* Sleep() is needed on Win9x and WinME */ - if (timeout) - Sleep(timeout); - file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); if (file == INVALID_HANDLE_VALUE) return FALSE; @@ -864,6 +858,19 @@ static void test_WritePrivateProfileString(void) CHAR path[MAX_PATH]; CHAR temp[MAX_PATH];
+ SetLastError(0xdeadbeef); + ret = WritePrivateProfileStringW(NULL, NULL, NULL, NULL); + if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + { + /* Win9x/WinME needs (variable) timeouts between tests and even long timeouts don't + * guarantee a correct result. + * Win9x/WinMe also produces different ini files where there is always a newline before + * a section start (except for the first one). + */ + win_skip("WritePrivateProfileString on Win9x/WinME is hard to test reliably\n"); + return; + } + GetTempPathA(MAX_PATH, temp); GetTempFileNameA(temp, "wine", 0, path); DeleteFileA(path); @@ -878,8 +885,6 @@ static void test_WritePrivateProfileString(void) broken(GetLastError() == ERROR_INVALID_PARAMETER) || /* NT4 */ broken(GetLastError() == 0xdeadbeef), /* Win9x and WinME */ "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); - if (GetLastError() == 0xdeadbeef) - timeout = 1000; ok(GetFileAttributesA(path) == INVALID_FILE_ATTRIBUTES, "Expected path to not exist\n");