Vincent Povirk : advapi32: Add test for RegDeleteValue.

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


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

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

advapi32: Add test for RegDeleteValue.

---

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

diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 9684a2f..d0ef19e 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -1945,6 +1945,32 @@ static void test_deleted_key(void)
     setup_main_key();
 }
 
+static void test_delete_value(void)
+{
+    LONG res;
+    char longname[401];
+
+    res = RegSetValueExA( hkey_main, "test", 0, REG_SZ, (const BYTE*)"value", 6 );
+    ok(res == ERROR_SUCCESS, "expect ERROR_SUCCESS, got %i\n", res);
+
+    res = RegQueryValueExA( hkey_main, "test", NULL, NULL, NULL, NULL);
+    ok(res == ERROR_SUCCESS, "expect ERROR_SUCCESS, got %i\n", res);
+
+    res = RegDeleteValueA( hkey_main, "test" );
+    ok(res == ERROR_SUCCESS, "expect ERROR_SUCCESS, got %i\n", res);
+
+    res = RegQueryValueExA( hkey_main, "test", NULL, NULL, NULL, NULL);
+    ok(res == ERROR_FILE_NOT_FOUND, "expect ERROR_FILE_NOT_FOUND, got %i\n", res);
+
+    res = RegDeleteValueA( hkey_main, "test" );
+    ok(res == ERROR_FILE_NOT_FOUND, "expect ERROR_FILE_NOT_FOUND, got %i\n", res);
+
+    memset(longname, 'a', 400);
+    longname[400] = 0;
+    res = RegDeleteValueA( hkey_main, longname );
+    todo_wine ok(res == ERROR_FILE_NOT_FOUND, "expect ERROR_FILE_NOT_FOUND, got %i\n", res);
+}
+
 START_TEST(registry)
 {
     /* Load pointers for functions that are not available in all Windows versions */
@@ -1980,6 +2006,7 @@ START_TEST(registry)
     test_reg_delete_tree();
     test_rw_order();
     test_deleted_key();
+    test_delete_value();
 
     /* cleanup */
     delete_key( hkey_main );




More information about the wine-cvs mailing list