reg/tests: Use a helper function to delete registry keys.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-09-25 06:55:51 +00:00 committed by Alexandre Julliard
parent ba0a7b0f26
commit 2ce7d1f206
1 changed files with 42 additions and 60 deletions

View File

@ -128,6 +128,18 @@ static void add_key_(unsigned line, const HKEY hkey, const char *path, HKEY *sub
lok(err == ERROR_SUCCESS, "RegCreateKeyExA failed: %d\n", err); lok(err == ERROR_SUCCESS, "RegCreateKeyExA failed: %d\n", err);
} }
#define delete_key(k,p) delete_key_(__LINE__,k,p)
static void delete_key_(unsigned line, const HKEY hkey, const char *path)
{
if (path && *path)
{
LONG err;
err = RegDeleteKeyA(hkey, path);
lok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", err);
}
}
static LONG delete_tree(const HKEY key, const char *subkey) static LONG delete_tree(const HKEY key, const char *subkey)
{ {
HKEY hkey; HKEY hkey;
@ -238,14 +250,12 @@ static void test_add(void)
run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest3\\ /f", &r); run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest3\\ /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
verify_key(hkey, "keytest3"); verify_key(hkey, "keytest3");
err = RegDeleteKeyA(hkey, "keytest3"); delete_key(hkey, "keytest3");
ok(err == ERROR_SUCCESS, "got exit code %d\n", err);
run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest4 /f", &r); run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest4 /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
verify_key(hkey, "keytest4"); verify_key(hkey, "keytest4");
err = RegDeleteKeyA(hkey, "keytest4"); delete_key(hkey, "keytest4");
ok(err == ERROR_SUCCESS, "got exit code %d\n", err);
/* REG_NONE */ /* REG_NONE */
run_reg_exe("reg add HKCU\\" KEY_BASE " /v none0 /d deadbeef /t REG_NONE /f", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v none0 /d deadbeef /t REG_NONE /f", &r);
@ -567,8 +577,7 @@ static void test_add(void)
run_reg_exe("reg add HKCU\\" KEY_BASE " /v invalid4 -", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v invalid4 -", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %u, expected 1\n", r); ok(r == REG_EXIT_FAILURE, "got exit code %u, expected 1\n", r);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_key(HKEY_CURRENT_USER, KEY_BASE);
ok(err == ERROR_SUCCESS, "got %d\n", err);
} }
static void test_delete(void) static void test_delete(void)
@ -706,8 +715,7 @@ static void test_query(void)
"got exit code %d, expected 0\n", r); "got exit code %d, expected 0\n", r);
/* Clean-up, then query */ /* Clean-up, then query */
err = RegDeleteKeyA(key, "subkey"); delete_key(key, "subkey");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegCloseKey(key); err = RegCloseKey(key);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
@ -715,8 +723,7 @@ static void test_query(void)
run_reg_exe("reg query HKCU\\" KEY_BASE "\\subkey", &r); run_reg_exe("reg query HKCU\\" KEY_BASE "\\subkey", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_key(HKEY_CURRENT_USER, KEY_BASE);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
run_reg_exe("reg query HKCU\\" KEY_BASE, &r); run_reg_exe("reg query HKCU\\" KEY_BASE, &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
@ -877,8 +884,7 @@ static void test_import(void)
err = RegCloseKey(hkey); err = RegCloseKey(hkey);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_key(HKEY_CURRENT_USER, KEY_BASE);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
sprintf(cmdline, "reg import %s %s", test1_reg, test2_reg); sprintf(cmdline, "reg import %s %s", test1_reg, test2_reg);
run_reg_exe(cmdline, &r); run_reg_exe(cmdline, &r);
@ -1639,8 +1645,7 @@ static void test_import(void)
verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0); verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0);
err = RegCloseKey(subkey); err = RegCloseKey(subkey);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1"); delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
test_import_str("REGEDIT4\n\n" test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n"
@ -1651,8 +1656,7 @@ static void test_import(void)
verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0); verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0);
err = RegCloseKey(subkey); err = RegCloseKey(subkey);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2"); delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
/* Test key creation */ /* Test key creation */
test_import_str("REGEDIT4\n\n" test_import_str("REGEDIT4\n\n"
@ -1679,15 +1683,13 @@ static void test_import(void)
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r); "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_key(hkey, "Subkey1c "); verify_key(hkey, "Subkey1c ");
err = RegDeleteKeyA(hkey, "Subkey1c "); delete_key(hkey, "Subkey1c ");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
test_import_str("REGEDIT4\n\n" test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r); "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_key(hkey, "Subkey1d\t"); verify_key(hkey, "Subkey1d\t");
err = RegDeleteKeyA(hkey, "Subkey1d\t"); delete_key(hkey, "Subkey1d\t");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
test_import_str("REGEDIT4\n\n" test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n"
@ -1699,8 +1701,7 @@ static void test_import(void)
ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err); ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey); RegCloseKey(subkey);
err = RegDeleteKeyA(hkey, "Subkey1e"); delete_key(hkey, "Subkey1e");
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got %u, expected 0\n", err);
test_import_str("REGEDIT4\n\n" test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n"
@ -1713,8 +1714,7 @@ static void test_import(void)
ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err); ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey); RegCloseKey(subkey);
err = RegDeleteKeyA(hkey, "Subkey1f\\\\"); delete_key(hkey, "Subkey1f\\\\");
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got %u, expected 0\n", err);
test_import_str("REGEDIT4\n\n" test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n"
@ -1728,8 +1728,7 @@ static void test_import(void)
ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err); ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey); RegCloseKey(subkey);
err = RegDeleteKeyA(hkey, "Subkey1g\\\\"); delete_key(hkey, "Subkey1g\\\\");
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got %u, expected 0\n", err);
/* Test key deletion. We start by creating some registry keys. */ /* Test key deletion. We start by creating some registry keys. */
test_import_str("REGEDIT4\n\n" test_import_str("REGEDIT4\n\n"
@ -1974,8 +1973,7 @@ static void test_import(void)
verify_reg_nonexist(hkey, "Wine54b"); verify_reg_nonexist(hkey, "Wine54b");
verify_key(hkey, "Subkey2"); verify_key(hkey, "Subkey2");
err = RegDeleteKeyA(hkey, "Subkey2"); delete_key(hkey, "Subkey2");
ok(err == ERROR_SUCCESS, "RegDeleteKey failed: %u\n", err);
test_import_str("REGEDIT4\n\n" test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2347,8 +2345,7 @@ static void test_import(void)
err = RegCloseKey(hkey); err = RegCloseKey(hkey);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_key(HKEY_CURRENT_USER, KEY_BASE);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
} }
static void test_unicode_import(void) static void test_unicode_import(void)
@ -3118,8 +3115,7 @@ static void test_unicode_import(void)
verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0); verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0);
err = RegCloseKey(subkey); err = RegCloseKey(subkey);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1"); delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n"
@ -3130,8 +3126,7 @@ static void test_unicode_import(void)
verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0); verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0);
err = RegCloseKey(subkey); err = RegCloseKey(subkey);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2"); delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
/* Test key creation */ /* Test key creation */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@ -3158,15 +3153,13 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r); "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_key(hkey, "Subkey1c "); verify_key(hkey, "Subkey1c ");
err = RegDeleteKeyA(hkey, "Subkey1c "); delete_key(hkey, "Subkey1c ");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r); "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_key(hkey, "Subkey1d\t"); verify_key(hkey, "Subkey1d\t");
err = RegDeleteKeyA(hkey, "Subkey1d\t"); delete_key(hkey, "Subkey1d\t");
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n"
@ -3178,8 +3171,7 @@ static void test_unicode_import(void)
ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err); ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey); RegCloseKey(subkey);
err = RegDeleteKeyA(hkey, "Subkey1e"); delete_key(hkey, "Subkey1e");
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got %u, expected 0\n", err);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n"
@ -3192,8 +3184,7 @@ static void test_unicode_import(void)
ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err); ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey); RegCloseKey(subkey);
err = RegDeleteKeyA(hkey, "Subkey1f\\\\"); delete_key(hkey, "Subkey1f\\\\");
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got %u, expected 0\n", err);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n"
@ -3207,8 +3198,7 @@ static void test_unicode_import(void)
ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err); ok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got %u, expected 0\n", err);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
RegCloseKey(subkey); RegCloseKey(subkey);
err = RegDeleteKeyA(hkey, "Subkey1g\\\\"); delete_key(hkey, "Subkey1g\\\\");
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got %u, expected 0\n", err);
/* Test key deletion. We start by creating some registry keys. */ /* Test key deletion. We start by creating some registry keys. */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@ -3456,8 +3446,7 @@ static void test_unicode_import(void)
verify_reg_nonexist(hkey, "Wine54b"); verify_reg_nonexist(hkey, "Wine54b");
verify_key(hkey, "Subkey2"); verify_key(hkey, "Subkey2");
err = RegDeleteKeyA(hkey, "Subkey2"); delete_key(hkey, "Subkey2");
ok(err == ERROR_SUCCESS, "RegDeleteKey failed: %u\n", err);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -3836,8 +3825,7 @@ static void test_unicode_import(void)
err = RegCloseKey(hkey); err = RegCloseKey(hkey);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_key(HKEY_CURRENT_USER, KEY_BASE);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
} }
static void test_import_with_whitespace(void) static void test_import_with_whitespace(void)
@ -3986,8 +3974,7 @@ static void test_import_with_whitespace(void)
err = RegCloseKey(hkey); err = RegCloseKey(hkey);
ok(err == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_key(HKEY_CURRENT_USER, KEY_BASE);
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got %d, expected 0\n", err);
} }
static void test_unicode_import_with_whitespace(void) static void test_unicode_import_with_whitespace(void)
@ -4136,8 +4123,7 @@ static void test_unicode_import_with_whitespace(void)
err = RegCloseKey(hkey); err = RegCloseKey(hkey);
ok(err == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", err); ok(err == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", err);
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_key(HKEY_CURRENT_USER, KEY_BASE);
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got %d, expected 0\n", err);
} }
static void test_import_31(void) static void test_import_31(void)
@ -4252,8 +4238,7 @@ static void test_import_31(void)
RegCloseKey(hkey); RegCloseKey(hkey);
err = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE); delete_key(HKEY_CLASSES_ROOT, KEY_BASE);
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", err);
} }
#define compare_export(f,e) compare_export_(__LINE__,f,e) #define compare_export(f,e) compare_export_(__LINE__,f,e)
@ -4487,10 +4472,8 @@ static void test_export(void)
err = DeleteFileA("file.reg"); err = DeleteFileA("file.reg");
todo_wine ok(err, "DeleteFile failed: %u\n", GetLastError()); todo_wine ok(err, "DeleteFile failed: %u\n", GetLastError());
err = RegDeleteKeyA(hkey, "Subkey1"); delete_key(hkey, "Subkey1");
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", err); delete_key(hkey, "Subkey2");
err = RegDeleteKeyA(hkey, "Subkey2");
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", err);
/* Test the export order of registry values. Windows exports registry values /* Test the export order of registry values. Windows exports registry values
* in order of creation; Wine uses alphabetical order. * in order of creation; Wine uses alphabetical order.
@ -4507,8 +4490,7 @@ static void test_export(void)
err = DeleteFileA("file.reg"); err = DeleteFileA("file.reg");
todo_wine ok(err, "DeleteFile failed: %u\n", GetLastError()); todo_wine ok(err, "DeleteFile failed: %u\n", GetLastError());
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); delete_key(HKEY_CURRENT_USER, KEY_BASE);
ok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", err);
} }
START_TEST(reg) START_TEST(reg)