Austin English : kernel32/tests: Remove win9x hacks.

Alexandre Julliard julliard at winehq.org
Mon Aug 22 13:29:14 CDT 2011


Module: wine
Branch: master
Commit: e2cbe25ba76925d30ed87d260bcada7049688734
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e2cbe25ba76925d30ed87d260bcada7049688734

Author: Austin English <austinenglish at gmail.com>
Date:   Tue Aug  9 13:06:26 2011 -0700

kernel32/tests: Remove win9x hacks.

---

 dlls/kernel32/tests/atom.c     |   39 ++++++++++-----------------------------
 dlls/kernel32/tests/debugger.c |   10 +++-------
 dlls/kernel32/tests/sync.c     |   21 ++++-----------------
 3 files changed, 17 insertions(+), 53 deletions(-)

diff --git a/dlls/kernel32/tests/atom.c b/dlls/kernel32/tests/atom.c
index f85d272..15ef04c 100644
--- a/dlls/kernel32/tests/atom.c
+++ b/dlls/kernel32/tests/atom.c
@@ -192,26 +192,16 @@ static void test_get_atom_name(void)
         else
             ok( !len, "bad length %d\n", len );
 
-	SetLastError(0xdeadbeef);
+        SetLastError(0xdeadbeef);
         len = GlobalGetAtomNameA( (ATOM)i, buf, 2);
-	if (!len) /* the NT way */
-	{
-	    ok(GetLastError() == (i ? ERROR_MORE_DATA : ERROR_INVALID_PARAMETER) ||
-               GetLastError() == 0xdeadbeef,  /* the Win 9x way */
-               "wrong error conditions %u for %u\n", GetLastError(), i);
-	}
-	else /* the Win 9x way */
-	{
-	    ok(GetLastError() == 0xdeadbeef,
-               "wrong error conditions %u for %u\n", GetLastError(), i);
-	}
+        ok(!len, "bad length %d\n", len);
+	ok(GetLastError() == ERROR_MORE_DATA || GetLastError() == ERROR_INVALID_PARAMETER,
+            "wrong error conditions %u for %u\n", GetLastError(), i);
     }
 
     memset( buf, '.', sizeof(buf) );
     len = GlobalGetAtomNameA( atom, buf, 6 );
-    ok( len == 0 ||
-        len == 5, /* win9x */
-        "bad length %d\n", len );
+    ok( len == 0, "bad length %d\n", len );
     ok( !memcmp( buf, "fooba\0....", 10 ), "bad buffer contents\n");
     if (unicode_OS)
     {
@@ -238,14 +228,8 @@ static void test_get_atom_name(void)
     memset(out, '.', sizeof(out));
     SetLastError(0xdeadbeef);
     len = GlobalGetAtomNameA(atom, out, 10);
-    if (!len) /* the NT way */
-    {
-        ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%u instead of %u)\n", GetLastError(), ERROR_MORE_DATA);
-    }
-    else /* the Win9x way */
-    {
-        ok(GetLastError() == 0xdeadbeef, "wrong error code (%u instead of %u)\n", GetLastError(), 0xdeadbeef);
-    }
+    ok(!len, "bad length %d\n", len);
+    ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%u instead of %u)\n", GetLastError(), ERROR_MORE_DATA);
     for (i = 0; i < 9; i++)
     {
         ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]);
@@ -487,13 +471,11 @@ static void test_local_get_atom_name(void)
         /* ERROR_MORE_DATA is on nt3.51 sp5 */
         if (i)
             ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
-               GetLastError() == ERROR_MORE_DATA ||
-               GetLastError() == 0xdeadbeef, /* the Win 9x way */
+               GetLastError() == ERROR_MORE_DATA,
                "wrong error conditions %u for %u\n", GetLastError(), i);
         else
             ok(GetLastError() == ERROR_INVALID_PARAMETER ||
-               GetLastError() == ERROR_MORE_DATA ||
-               GetLastError() == 0xdeadbeef, /* the Win 9x way */
+               GetLastError() == ERROR_MORE_DATA,
                "wrong error conditions %u for %u\n", GetLastError(), i);
     }
     /* test string limits & overflow */
@@ -522,8 +504,7 @@ static void test_local_get_atom_name(void)
 
     /* ERROR_MORE_DATA is on nt3.51 sp5 */
     ok(GetLastError() == ERROR_INVALID_PARAMETER ||
-       GetLastError() == ERROR_MORE_DATA ||
-       GetLastError() == 0xdeadbeef, /* the Win 9x way */
+       GetLastError() == ERROR_MORE_DATA,
        "wrong error code (%u)\n", GetLastError());
 
     if (unicode_OS)
diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c
index 7f7b052..2094190 100644
--- a/dlls/kernel32/tests/debugger.c
+++ b/dlls/kernel32/tests/debugger.c
@@ -337,14 +337,12 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks)
          */
         ok(exit_code == STATUS_DEBUGGER_INACTIVE ||
            broken(exit_code == STATUS_ACCESS_VIOLATION) || /* Intermittent Vista+ */
-           broken(exit_code == 0xffffffff) || /* Win9x */
            broken(exit_code == WAIT_ABANDONED), /* NT4, W2K */
            "wrong exit code : %08x\n", exit_code);
     }
     else
         ok(exit_code == STATUS_ACCESS_VIOLATION ||
-           broken(exit_code == WAIT_ABANDONED) || /* NT4, W2K, W2K3 */
-           broken(exit_code == 0xffffffff), /* Win9x, WinME */
+           broken(exit_code == WAIT_ABANDONED), /* NT4, W2K, W2K3 */
            "wrong exit code : %08x\n", exit_code);
     CloseHandle(info.hProcess);
 
@@ -478,10 +476,8 @@ static void test_ExitCode(void)
         crash_and_debug(hkey, test_exe, "dbg,none");
     else
         skip("\"none\" debugger test needs user interaction\n");
-    if (disposition == REG_CREATED_NEW_KEY)
-        win_skip("'dbg,event,order' test doesn't finish on Win9x/WinMe\n");
-    else
-        crash_and_debug(hkey, test_exe, "dbg,event,order");
+    ok(disposition == REG_OPENED_EXISTING_KEY, "expected REG_OPENED_EXISTING_KEY, got %d\n", disposition);
+    crash_and_debug(hkey, test_exe, "dbg,event,order");
     crash_and_debug(hkey, test_exe, "dbg,attach,event,code2");
     if (pDebugSetProcessKillOnExit)
         crash_and_debug(hkey, test_exe, "dbg,attach,event,nokill");
diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c
index 72f33ae..e2a6c7e 100644
--- a/dlls/kernel32/tests/sync.c
+++ b/dlls/kernel32/tests/sync.c
@@ -149,16 +149,12 @@ static void test_mutex(void)
     SetLastError(0xdeadbeef);
     hOpened = OpenMutex(READ_CONTROL, FALSE, "WINETESTMUTEX");
     ok(!hOpened, "OpenMutex succeeded\n");
-    ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
-       GetLastError() == ERROR_INVALID_NAME, /* win9x */
-       "wrong error %u\n", GetLastError());
+    ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     hOpened = OpenMutex(READ_CONTROL, FALSE, "winetestmutex");
     ok(!hOpened, "OpenMutex succeeded\n");
-    ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
-       GetLastError() == ERROR_INVALID_NAME, /* win9x */
-       "wrong error %u\n", GetLastError());
+    ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
 
     SetLastError(0xdeadbeef);
     hOpened = CreateMutex(NULL, FALSE, "WineTestMutex");
@@ -328,9 +324,7 @@ static void test_event(void)
     SetLastError(0xdeadbeef);
     handle2 = OpenEventA( EVENT_ALL_ACCESS, FALSE, __FILE__ ": TEST EVENT");
     ok( !handle2, "OpenEvent succeeded\n");
-    ok( GetLastError() == ERROR_FILE_NOT_FOUND ||
-        GetLastError() == ERROR_INVALID_NAME, /* win9x */
-        "wrong error %u\n", GetLastError());
+    ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
 
     CloseHandle( handle );
 }
@@ -366,9 +360,7 @@ static void test_semaphore(void)
     SetLastError(0xdeadbeef);
     handle2 = OpenSemaphoreA( SEMAPHORE_ALL_ACCESS, FALSE, __FILE__ ": TEST SEMAPHORE");
     ok( !handle2, "OpenSemaphore succeeded\n");
-    ok( GetLastError() == ERROR_FILE_NOT_FOUND ||
-        GetLastError() == ERROR_INVALID_NAME, /* win9x */
-        "wrong error %u\n", GetLastError());
+    ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError());
 
     CloseHandle( handle );
 }
@@ -938,11 +930,6 @@ static void test_WaitForSingleObject(void)
     DWORD ret;
 
     signaled = CreateEventW(NULL, TRUE, TRUE, NULL);
-    if(signaled == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
-    {
-        win_skip("Handles work differently on win9x\n");
-        return;
-    }
     nonsignaled = CreateEventW(NULL, TRUE, FALSE, NULL);
     invalid = (HANDLE) 0xdeadbee0;
 




More information about the wine-cvs mailing list