From 3186a0046336e82a2e8133f8a5958e6250c6fe61 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Thu, 1 Jul 2021 23:22:48 +1000 Subject: [PATCH] reg/tests: Don't verify key deletion after calling delete_tree(). Signed-off-by: Hugh McMaster Signed-off-by: Alexandre Julliard --- programs/reg/tests/add.c | 1 - programs/reg/tests/copy.c | 27 --------------------------- programs/reg/tests/delete.c | 9 --------- programs/reg/tests/export.c | 1 - programs/reg/tests/import.c | 4 ---- programs/reg/tests/query.c | 1 - 6 files changed, 43 deletions(-) diff --git a/programs/reg/tests/add.c b/programs/reg/tests/add.c index 469f354de39..2c1a2cf35e3 100644 --- a/programs/reg/tests/add.c +++ b/programs/reg/tests/add.c @@ -226,7 +226,6 @@ static void test_command_syntax(void) DWORD r; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg add", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); diff --git a/programs/reg/tests/copy.c b/programs/reg/tests/copy.c index c6a83e57276..e9542a67f5e 100644 --- a/programs/reg/tests/copy.c +++ b/programs/reg/tests/copy.c @@ -127,10 +127,7 @@ static void test_copy_empty_key(void) DWORD r; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); add_key(HKEY_CURRENT_USER, COPY_SRC, 0, NULL); @@ -192,10 +189,7 @@ static void test_copy_simple_data(void) DWORD r, dword; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); add_key(HKEY_CURRENT_USER, COPY_SRC, 0, &hkey); @@ -262,10 +256,7 @@ static void test_copy_complex_data(void) DWORD r, dword; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); add_key(HKEY_CURRENT_USER, COPY_SRC, 0, &hkey); @@ -331,10 +322,7 @@ static void test_copy_key_order(void) DWORD r; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); add_key(HKEY_CURRENT_USER, COPY_SRC, 0, &hkey); add_key(hkey, "Subkey2", 0, NULL); @@ -356,10 +344,7 @@ static void test_copy_value_order(void) DWORD r; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); add_key(HKEY_CURRENT_USER, COPY_SRC, 0, &hkey); add_value(hkey, "Value 2", REG_SZ, "I was added first!", 19); @@ -381,10 +366,7 @@ static void test_copy_hex_data(void) DWORD r; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); /* Try copying empty hex values */ add_key(HKEY_CURRENT_USER, COPY_SRC, 0, &hkey); @@ -450,10 +432,7 @@ static void test_copy_embedded_null_values(void) DWORD r; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" COPY_SRC "]\n" @@ -483,10 +462,7 @@ static void test_copy_slashes(void) DWORD r; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); add_key(HKEY_CURRENT_USER, COPY_SRC, 0, &hkey); add_key(hkey, "https://winehq.org", 0, NULL); @@ -509,10 +485,7 @@ static void test_copy_escaped_null_values(void) DWORD r; delete_tree(HKEY_CURRENT_USER, COPY_SRC, 0); - verify_key_nonexist(HKEY_CURRENT_USER, COPY_SRC, 0); - delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); add_key(HKEY_CURRENT_USER, COPY_SRC, 0, &hkey); add_value(hkey, "Wine5a", REG_SZ, "\\0", 3); diff --git a/programs/reg/tests/delete.c b/programs/reg/tests/delete.c index 0c313c12a31..2bc1abadfcb 100644 --- a/programs/reg/tests/delete.c +++ b/programs/reg/tests/delete.c @@ -24,7 +24,6 @@ static void test_command_syntax(void) DWORD r; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg delete", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); @@ -85,7 +84,6 @@ static void test_delete(void) const DWORD deadbeef = 0xdeadbeef; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); /* Create a test key */ add_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey); @@ -184,7 +182,6 @@ static void test_registry_view_win32(void) if (!is_win32) return; delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); - verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); /* Test deletion from the 32-bit registry view (32-bit Windows) */ create_test_key(KEY_WOW64_32KEY); @@ -257,10 +254,7 @@ static void test_registry_view_win64(void) if (!is_win64) return; delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); - verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); - delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); - verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); /* Test deletion from the 32-bit registry view (64-bit Windows) */ create_test_key(KEY_WOW64_32KEY); @@ -336,10 +330,7 @@ static void test_registry_view_wow64(void) if (!is_wow64) return; delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); - verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); - delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); - verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); /* Test deletion from the 32-bit registry view (WOW64) */ create_test_key(KEY_WOW64_32KEY); diff --git a/programs/reg/tests/export.c b/programs/reg/tests/export.c index 0f48443384e..e32f750079e 100644 --- a/programs/reg/tests/export.c +++ b/programs/reg/tests/export.c @@ -177,7 +177,6 @@ static void test_export(void) BYTE hex[4], buffer[8]; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); diff --git a/programs/reg/tests/import.c b/programs/reg/tests/import.c index 2531ba336e8..ace45cf5984 100644 --- a/programs/reg/tests/import.c +++ b/programs/reg/tests/import.c @@ -102,7 +102,6 @@ static void test_import(void) BYTE hex[8]; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg import", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); @@ -1655,7 +1654,6 @@ static void test_unicode_import(void) BYTE hex[8]; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); test_import_wstr("REGEDIT\n", &r); ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */, @@ -3201,7 +3199,6 @@ static void test_import_with_whitespace(void) DWORD r, dword; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); test_import_str(" REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n", &r); @@ -3347,7 +3344,6 @@ static void test_unicode_import_with_whitespace(void) DWORD r, dword; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); test_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n", &r); diff --git a/programs/reg/tests/query.c b/programs/reg/tests/query.c index 590d322c37c..eca392b64d9 100644 --- a/programs/reg/tests/query.c +++ b/programs/reg/tests/query.c @@ -204,7 +204,6 @@ static void test_query(void) BYTE buf[512]; delete_tree(HKEY_CURRENT_USER, KEY_BASE, 0); - verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE, 0); /* Key not present */ run_reg_exe("reg query HKCU\\" KEY_BASE, &r);