Vincent Povirk : advapi32: Add tests for registry keys that have been deleted.

Alexandre Julliard julliard at winehq.org
Thu Apr 1 11:25:04 CDT 2010


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Mar 31 17:01:22 2010 -0500

advapi32: Add tests for registry keys that have been deleted.

---

 dlls/advapi32/tests/registry.c |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 3a65339..9684a2f 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -1910,6 +1910,41 @@ static void test_redirection(void)
     RegCloseKey( root64 );
 }
 
+static void test_deleted_key(void)
+{
+    HKEY hkey, hkey2;
+    char value[20];
+    DWORD val_count, type;
+    LONG res;
+
+    /* Open the test key, then delete it while it's open */
+    RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey );
+
+    delete_key( hkey_main );
+
+    val_count = 20;
+    type = 0;
+    res = RegEnumValueA( hkey, 0, value, &val_count, NULL, &type, 0, 0 );
+    todo_wine ok(res == ERROR_KEY_DELETED, "expect ERROR_KEY_DELETED, got %i\n", res);
+
+    res = RegSetValueExA( hkey, "test", 0, REG_SZ, (const BYTE*)"value", 6);
+    todo_wine ok(res == ERROR_KEY_DELETED, "expect ERROR_KEY_DELETED, got %i\n", res);
+
+    res = RegOpenKeyA( hkey, "test", &hkey2 );
+    todo_wine ok(res == ERROR_KEY_DELETED, "expect ERROR_KEY_DELETED, got %i\n", res);
+    if (res == 0)
+        RegCloseKey( hkey2 );
+
+    res = RegCreateKeyA( hkey, "test", &hkey2 );
+    ok(res == ERROR_KEY_DELETED, "expect ERROR_KEY_DELETED, got %i\n", res);
+    if (res == 0)
+        RegCloseKey( hkey2 );
+
+    RegCloseKey( hkey );
+
+    setup_main_key();
+}
+
 START_TEST(registry)
 {
     /* Load pointers for functions that are not available in all Windows versions */
@@ -1944,6 +1979,7 @@ START_TEST(registry)
 
     test_reg_delete_tree();
     test_rw_order();
+    test_deleted_key();
 
     /* cleanup */
     delete_key( hkey_main );




More information about the wine-cvs mailing list