tests advapi32, fix Windows 95 issues
Jakob Eriksson
jakov at vmlinux.org
Tue Mar 22 09:49:04 CST 2005
Check:
http://test.winehq.org/data/200503181000/95_jmelgarejo95casa/advapi32:registry.txt
I tried to fix some of these.
regards,
Jakob
-------------- next part --------------
Index: dlls/advapi32/tests/registry.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/tests/registry.c,v
retrieving revision 1.13
diff -u -r1.13 registry.c
--- dlls/advapi32/tests/registry.c 25 Feb 2005 16:52:10 -0000 1.13
+++ dlls/advapi32/tests/registry.c 22 Mar 2005 15:48:09 -0000
@@ -89,9 +89,13 @@
else
ok( !res, "RegSetValueExA returned %ld\n", res );
res = RegSetValueExA( hkey_main, "Test", 0, REG_EXPAND_SZ, NULL, 0 );
- ok( !res, "RegSetValueExA returned %ld\n", res );
+ ok( ERROR_SUCCESS == res || ERROR_INVALID_PARAMETER == res, "RegSetValueExA returned %ld\n", res );
+ if (ERROR_INVALID_PARAMETER == res)
+ trace ("RegSetValueExA() returned ERROR_INVALID_PARAMETER\n");
res = RegSetValueExA( hkey_main, "Test", 0, REG_BINARY, NULL, 0 );
- ok( !res, "RegSetValueExA returned %ld\n", res );
+ ok( ERROR_SUCCESS == res || ERROR_INVALID_PARAMETER == res, "RegSetValueExA returned %ld\n", res );
+ if (ERROR_INVALID_PARAMETER == res)
+ trace ("RegSetValueExA() returned ERROR_INVALID_PARAMETER\n");
res = RegSetValueExA( hkey_main, "Test", 0, REG_SZ, (BYTE *)"foobar", 7 );
ok( res == 0, "RegSetValueExA failed error %ld\n", res );
@@ -314,7 +318,8 @@
*/
hkResult = hkPreserve;
ret = RegOpenKeyA(NULL, "Software\\Wine\\Test", &hkResult);
- ok(ret == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", ret);
+ ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 95 returns BADKEY */
+ "expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %ld\n", ret);
ok(hkResult == hkPreserve, "expected hkResult == hkPreserve\n");
RegCloseKey(hkResult);
@@ -336,12 +341,13 @@
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
/* try to close the key twice */
- ret = RegCloseKey(hkHandle);
- ok(ret == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", ret);
+ ret = RegCloseKey(hkHandle); /* Windows 95 doesn't mind. */
+ trace ("closing key twice, got %ld\n", ret);
/* try to close a NULL handle */
ret = RegCloseKey(NULL);
- ok(ret == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %ld\n", ret);
+ ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 95 returns BADKEY */
+ "expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %ld\n", ret);
}
START_TEST(registry)
More information about the wine-patches
mailing list