[PATCH] advapi32/tests: Handle the results from Win9x in the tests

Detlef Riekenberg wine.dev at web.de
Tue Jul 29 16:58:04 CDT 2008


---
 dlls/advapi32/tests/registry.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 94ce15a..95608c6 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -159,9 +159,8 @@ static const char *wine_debugstr_wn( const WCHAR *str, int n )
 
 
 #define ADVAPI32_GET_PROC(func) \
-    p ## func = (void*)GetProcAddress(hadvapi32, #func); \
-    if(!p ## func) \
-      trace("GetProcAddress(%s) failed\n", #func);
+    p ## func = (void*)GetProcAddress(hadvapi32, #func);
+
 
 static void InitFunctionPtrs(void)
 {
@@ -332,13 +331,21 @@ static void test_set_value(void)
     test_hkey_main_Value_A(NULL, substring2A, sizeof(substring2A));
     test_hkey_main_Value_W(NULL, substring2W, sizeof(substring2W));
 
-    /* only REG_SZ is supported */
+    /* only REG_SZ is supported on NT*/
     ret = RegSetValueA(hkey_main, NULL, REG_BINARY, string2A, sizeof(string2A));
-    ok(ret == ERROR_INVALID_PARAMETER, "RegSetValueA should have returned ERROR_INVALID_PARAMETER instead of %d\n", ret);
+    /* NT: ERROR_INVALID_PARAMETER, 9x: ERROR_SUCCESS */
+    ok(ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_SUCCESS),
+        "got %d (expected ERROR_INVALID_PARAMETER or ERROR_SUCCESS)\n", ret);
+
     ret = RegSetValueA(hkey_main, NULL, REG_EXPAND_SZ, string2A, sizeof(string2A));
-    ok(ret == ERROR_INVALID_PARAMETER, "RegSetValueA should have returned ERROR_INVALID_PARAMETER instead of %d\n", ret);
+    /* NT: ERROR_INVALID_PARAMETER, 9x: ERROR_SUCCESS */
+    ok(ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_SUCCESS),
+        "got %d (expected ERROR_INVALID_PARAMETER or ERROR_SUCCESS)\n", ret);
+
     ret = RegSetValueA(hkey_main, NULL, REG_MULTI_SZ, string2A, sizeof(string2A));
-    ok(ret == ERROR_INVALID_PARAMETER, "RegSetValueA should have returned ERROR_INVALID_PARAMETER instead of %d\n", ret);
+    /* NT: ERROR_INVALID_PARAMETER, 9x: ERROR_SUCCESS */
+    ok(ret == ERROR_INVALID_PARAMETER || broken(ret == ERROR_SUCCESS),
+        "got %d (expected ERROR_INVALID_PARAMETER or ERROR_SUCCESS)\n", ret);
 
     /* Test RegSetValueExA with a 'zero-byte' string (as Office 2003 does).
      * Surprisingly enough we're supposed to get zero bytes out of it.
-- 
1.5.4.3


--=-5iyVL12K+IfMlt+ijLRC--




More information about the wine-patches mailing list