kernel: Make atom tests pass on win9x

Vitaliy Margolen wine-patch at kievinfo.com
Wed Oct 5 23:55:37 CDT 2005



Vitaliy Margolen

changelog:
  Fix atom tests on win9x
-------------- next part --------------
Index: dlls/kernel/tests/atom.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/atom.c,v
retrieving revision 1.10
diff -u -p -r1.10 atom.c
--- dlls/kernel/tests/atom.c	28 Sep 2005 11:58:20 -0000	1.10
+++ dlls/kernel/tests/atom.c	6 Oct 2005 04:53:51 -0000
@@ -209,7 +209,8 @@ static void test_get_atom_name(void)
         len = GlobalGetAtomNameA( (ATOM)i, buf, 2);
 	if (!len) /* the NT way */
 	{
-	    ok(GetLastError() == (i ? ERROR_MORE_DATA : ERROR_INVALID_PARAMETER),
+	    ok(GetLastError() == (i ? ERROR_MORE_DATA : ERROR_INVALID_PARAMETER) ||
+               GetLastError() == 0xdeadbeef,  /* the Win 9x way */
 	       "wrong error conditions %lu for %u\n", GetLastError(), i);
 	}
 	else /* the Win 9x way */
@@ -462,9 +463,13 @@ static void test_local_get_atom_name(voi
         len = GetAtomNameA( (ATOM)i, buf, 1);
         ok(!len, "succeed\n");
         if (i)
-            todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error conditions %lu for %u\n", GetLastError(), i);
+            todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
+                         GetLastError() == 0xdeadbeef, /* the Win 9x way */
+                         "wrong error conditions %lu for %u\n", GetLastError(), i);
         else
-            ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error conditions %lu for %u\n", GetLastError(), i);
+            ok(GetLastError() == ERROR_INVALID_PARAMETER ||
+               GetLastError() == 0xdeadbeef, /* the Win 9x way */
+               "wrong error conditions %lu for %u\n", GetLastError(), i);
     }
     /* test string limits & overflow */
     do_initA(in, "abcdefghij", 255);
@@ -489,7 +494,8 @@ static void test_local_get_atom_name(voi
     do_initA(in, "abcdefghij", 256);
     atom = AddAtomA(in);
     ok(!atom, "succeeded\n");
-    ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error code (%lu)\n", GetLastError());
+    ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == 0xdeadbeef, /* the Win 9x way */
+       "wrong error code (%lu)\n", GetLastError());
 
     if (unicode_OS)
     {


More information about the wine-patches mailing list