Commit c86e6244 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

regedit/tests: Ensure test key is fully removed before each sequence begins.

parent 8a43d29e
...@@ -273,9 +273,8 @@ static void test_basic_import(void) ...@@ -273,9 +273,8 @@ static void test_basic_import(void)
char buffer[256]; char buffer[256];
BYTE hex[8]; BYTE hex[8];
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
"RegDeleteKeyA failed: %d\n", lr);
exec_import_str("REGEDIT4\n\n" exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
...@@ -685,8 +684,8 @@ static void test_basic_import_unicode(void) ...@@ -685,8 +684,8 @@ static void test_basic_import_unicode(void)
char buffer[256]; char buffer[256];
BYTE hex[8]; BYTE hex[8];
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
...@@ -1155,12 +1154,11 @@ static void test_basic_import_31(void) ...@@ -1155,12 +1154,11 @@ static void test_basic_import_31(void)
static void test_invalid_import(void) static void test_invalid_import(void)
{ {
LONG lr;
HKEY hkey; HKEY hkey;
DWORD dword = 0x8; DWORD dword = 0x8;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
...@@ -1661,12 +1659,11 @@ static void test_invalid_import(void) ...@@ -1661,12 +1659,11 @@ static void test_invalid_import(void)
static void test_invalid_import_unicode(void) static void test_invalid_import_unicode(void)
{ {
LONG lr;
HKEY hkey; HKEY hkey;
DWORD dword = 0x8; DWORD dword = 0x8;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
...@@ -2227,12 +2224,11 @@ static void test_invalid_import_31(void) ...@@ -2227,12 +2224,11 @@ static void test_invalid_import_31(void)
static void test_comments(void) static void test_comments(void)
{ {
LONG lr;
HKEY hkey; HKEY hkey;
DWORD dword; DWORD dword;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
...@@ -2466,12 +2462,11 @@ static void test_comments(void) ...@@ -2466,12 +2462,11 @@ static void test_comments(void)
static void test_comments_unicode(void) static void test_comments_unicode(void)
{ {
LONG lr;
HKEY hkey; HKEY hkey;
DWORD dword; DWORD dword;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
...@@ -2711,8 +2706,8 @@ static void test_import_with_whitespace(void) ...@@ -2711,8 +2706,8 @@ static void test_import_with_whitespace(void)
LONG lr; LONG lr;
DWORD dword; DWORD dword;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str(" REGEDIT4\n\n" exec_import_str(" REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"); "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
...@@ -2859,8 +2854,8 @@ static void test_import_with_whitespace_unicode(void) ...@@ -2859,8 +2854,8 @@ static void test_import_with_whitespace_unicode(void)
LONG lr; LONG lr;
DWORD dword; DWORD dword;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n" exec_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"); "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
...@@ -3006,8 +3001,8 @@ static void test_key_creation_and_deletion(void) ...@@ -3006,8 +3001,8 @@ static void test_key_creation_and_deletion(void)
HKEY hkey, subkey; HKEY hkey, subkey;
LONG lr; LONG lr;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"); "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
...@@ -3146,8 +3141,8 @@ static void test_key_creation_and_deletion_unicode(void) ...@@ -3146,8 +3141,8 @@ static void test_key_creation_and_deletion_unicode(void)
HKEY hkey, subkey; HKEY hkey, subkey;
LONG lr; LONG lr;
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"); "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
...@@ -3288,8 +3283,8 @@ static void test_value_deletion(void) ...@@ -3288,8 +3283,8 @@ static void test_value_deletion(void)
DWORD dword = 0x8; DWORD dword = 0x8;
BYTE hex[4] = {0x11, 0x22, 0x33, 0x44}; BYTE hex[4] = {0x11, 0x22, 0x33, 0x44};
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" exec_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"); "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
...@@ -3342,8 +3337,8 @@ static void test_value_deletion_unicode(void) ...@@ -3342,8 +3337,8 @@ static void test_value_deletion_unicode(void)
DWORD dword = 0x8; DWORD dword = 0x8;
BYTE hex[4] = {0x11, 0x22, 0x33, 0x44}; BYTE hex[4] = {0x11, 0x22, 0x33, 0x44};
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"); "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n");
...@@ -3527,8 +3522,8 @@ static void test_export(void) ...@@ -3527,8 +3522,8 @@ static void test_export(void)
"\"Wine4g\"=\"Value2\"\r\n" "\"Wine4g\"=\"Value2\"\r\n"
"\"Wine4h\"=\"abc\"\r\n\r\n"; "\"Wine4h\"=\"abc\"\r\n\r\n";
lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_tree(HKEY_CURRENT_USER, KEY_BASE);
ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with an empty key */ /* Test registry export with an empty key */
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey); add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment