Paul Vriens : advapi32/tests: Some cleanup.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Apr 2 06:22:58 CDT 2007


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

Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date:   Sat Mar 31 13:01:24 2007 +0200

advapi32/tests: Some cleanup.

---

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

diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 4296fd5..a3491c3 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -281,10 +281,13 @@ static void test_enum_value(void)
 
     /* Unicode tests */
 
-    SetLastError(0);
+    SetLastError(0xdeadbeef);
     res = RegSetValueExW( test_key, testW, 0, REG_SZ, (const BYTE *)foobarW, 7*sizeof(WCHAR) );
     if (res==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
-        return;
+    {
+        skip("RegSetValueExW is not implemented\n");
+        goto cleanup;
+    }
     ok( res == 0, "RegSetValueExW failed error %d\n", res );
 
     /* overflow both name and data */
@@ -342,6 +345,10 @@ static void test_enum_value(void)
     ok( type == REG_SZ, "type %d is not REG_SZ\n", type );
     ok( !memcmp( valueW, testW, sizeof(testW) ), "value is not 'Test'\n" );
     ok( !memcmp( dataW, foobarW, sizeof(foobarW) ), "data is not 'foobar'\n" );
+
+cleanup:
+    RegDeleteKeyA(test_key, "");
+    RegCloseKey(test_key);
 }
 
 static void test_query_value_ex(void)
@@ -783,14 +790,16 @@ static void test_reg_query_value(void)
     SetLastError(0xdeadbeef);
     size = MAX_PATH;
     ret = RegQueryValueA((HKEY)0xcafebabe, "subkey", val, &size);
-    ok(ret == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", ret);
+    ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 98 returns BADKEY */
+       "Expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n", ret);
     ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
 
     /* try a NULL hkey */
     SetLastError(0xdeadbeef);
     size = MAX_PATH;
     ret = RegQueryValueA(NULL, "subkey", val, &size);
-    ok(ret == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", ret);
+    ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 98 returns BADKEY */
+       "Expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n", ret);
     ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
 
     /* try a NULL value */
@@ -880,6 +889,7 @@ static void test_reg_query_value(void)
 
 cleanup:
     RegDeleteKeyA(subkey, "");
+    RegCloseKey(subkey);
 }
 
 START_TEST(registry)




More information about the wine-cvs mailing list