advapi32/tests: Add tests for deleting the default value.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2016-03-01 22:23:47 +11:00 committed by Alexandre Julliard
parent 80383dcf39
commit 50c5a2ce2e

View File

@ -3326,6 +3326,19 @@ static void test_delete_value(void)
res = RegDeleteValueA( hkey_main, longname );
ok(res == ERROR_FILE_NOT_FOUND || broken(res == ERROR_MORE_DATA), /* nt4, win2k */
"expect ERROR_FILE_NOT_FOUND, got %i\n", res);
/* Default registry value */
res = RegSetValueExA(hkey_main, "", 0, REG_SZ, (const BYTE *)"value", 6);
ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", res);
res = RegQueryValueExA(hkey_main, "", NULL, NULL, NULL, NULL);
ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", res);
res = RegDeleteValueA(hkey_main, "" );
ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", res);
res = RegQueryValueExA(hkey_main, "", NULL, NULL, NULL, NULL);
ok(res == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %d\n", res);
}
static void test_delete_key_value(void)
@ -3374,6 +3387,19 @@ static void test_delete_key_value(void)
ret = RegQueryValueExA(subkey, "test", NULL, NULL, NULL, NULL);
ok(ret == ERROR_FILE_NOT_FOUND, "got %d\n", ret);
/* Default registry value */
ret = RegSetValueExA(subkey, "", 0, REG_SZ, (const BYTE *)"value", 6);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
ret = RegQueryValueExA(subkey, "", NULL, NULL, NULL, NULL);
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
ret = pRegDeleteKeyValueA(hkey_main, "Subkey1", "" );
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
ret = RegQueryValueExA(subkey, "", NULL, NULL, NULL, NULL);
ok(ret == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %d\n", ret);
RegDeleteKeyA(subkey, "");
RegCloseKey(subkey);
}