Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/regedit/tests/regedit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index 66b95624455..de4ddfa76a3 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -1094,15 +1094,12 @@ static void test_basic_import_unicode(void) static void test_basic_import_31(void) { HKEY hkey; + DWORD dispos; LONG lr;
- lr = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, - "RegDeleteKeyA failed: %d\n", lr); - /* Check if regedit.exe is running with elevated privileges */ lr = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_READ, NULL, &hkey, NULL); + KEY_READ|KEY_SET_VALUE, NULL, &hkey, &dispos); if (lr == ERROR_ACCESS_DENIED) { win_skip("regedit.exe is not running with elevated privileges; " @@ -1110,6 +1107,9 @@ static void test_basic_import_31(void) return; }
+ if (dispos == REG_OPENED_EXISTING_KEY) + delete_value(hkey, NULL); + /* Test simple value */ exec_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\" KEY_BASE " = Value0\r\n");
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/regedit/tests/regedit.c | 57 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 31 deletions(-)
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index de4ddfa76a3..3b78951bfa9 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -273,9 +273,8 @@ static void test_basic_import(void) char buffer[256]; BYTE hex[8];
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, - "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n" @@ -685,8 +684,8 @@ static void test_basic_import_unicode(void) char buffer[256]; BYTE hex[8];
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n" @@ -1155,12 +1154,11 @@ static void test_basic_import_31(void)
static void test_invalid_import(void) { - LONG lr; HKEY hkey; DWORD dword = 0x8;
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n" @@ -1661,12 +1659,11 @@ static void test_invalid_import(void)
static void test_invalid_import_unicode(void) { - LONG lr; HKEY hkey; DWORD dword = 0x8;
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n" @@ -2227,12 +2224,11 @@ static void test_invalid_import_31(void)
static void test_comments(void) { - LONG lr; HKEY hkey; DWORD dword;
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n" @@ -2466,12 +2462,11 @@ static void test_comments(void)
static void test_comments_unicode(void) { - LONG lr; HKEY hkey; DWORD dword;
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n" @@ -2711,8 +2706,8 @@ static void test_import_with_whitespace(void) LONG lr; DWORD dword;
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str(" REGEDIT4\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n\n"); @@ -2859,8 +2854,8 @@ static void test_import_with_whitespace_unicode(void) LONG lr; DWORD dword;
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n\n"); @@ -3006,8 +3001,8 @@ static void test_key_creation_and_deletion(void) HKEY hkey, subkey; LONG lr;
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n\n"); @@ -3146,8 +3141,8 @@ static void test_key_creation_and_deletion_unicode(void) HKEY hkey, subkey; LONG lr;
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n\n"); @@ -3288,8 +3283,8 @@ static void test_value_deletion(void) DWORD dword = 0x8; BYTE hex[4] = {0x11, 0x22, 0x33, 0x44};
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n\n"); @@ -3342,8 +3337,8 @@ static void test_value_deletion_unicode(void) DWORD dword = 0x8; BYTE hex[4] = {0x11, 0x22, 0x33, 0x44};
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "]\n\n"); @@ -3527,8 +3522,8 @@ static void test_export(void) ""Wine4g"="Value2"\r\n" ""Wine4h"="abc"\r\n\r\n";
- lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); + verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with an empty key */ add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=85958
Your paranoid android.
=== w7u_adm (32 bit report) ===
regedit.exe: regedit: Timeout
=== w8adm (32 bit report) ===
regedit.exe: regedit: Timeout
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/regedit/tests/regedit.c | 103 ++++++++++++++----------------- 1 file changed, 47 insertions(+), 56 deletions(-)
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index 3b78951bfa9..7e84c4c9a2f 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -152,6 +152,15 @@ static void open_key_(unsigned line, const HKEY base, const char *path, const DW lok(lr == ERROR_SUCCESS, "RegOpenKeyExA failed: %d\n", lr); }
+#define close_key(k) close_key_(__LINE__,k) +static void close_key_(unsigned line, HKEY hkey) +{ + LONG lr; + + lr = RegCloseKey(hkey); + lok(lr == ERROR_SUCCESS, "RegCloseKey failed: %d\n", lr); +} + #define verify_key(k,s) verify_key_(__LINE__,k,s) static void verify_key_(unsigned line, HKEY key_base, const char *subkey) { @@ -482,8 +491,7 @@ static void test_basic_import(void) ""Wine\\31"="Test value"\n\n"); open_key(hkey, "Subkey"1", 0, &subkey); verify_reg(subkey, "Wine\31", REG_SZ, "Test value", 11, 0); - lr = RegCloseKey(subkey); - ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + close_key(subkey); delete_key(HKEY_CURRENT_USER, KEY_BASE "\Subkey"1");
exec_import_str("REGEDIT4\n\n" @@ -491,8 +499,7 @@ static void test_basic_import(void) ""123/\"4;'5"="Random value name"\n\n"); open_key(hkey, "Subkey/2", 0, &subkey); verify_reg(subkey, "123/"4;'5", REG_SZ, "Random value name", 18, 0); - lr = RegCloseKey(subkey); - ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + close_key(subkey); delete_key(HKEY_CURRENT_USER, KEY_BASE "\Subkey/2");
/* Test the accepted range of the hex-based data types */ @@ -670,7 +677,7 @@ static void test_basic_import(void) verify_reg(hkey, "Wine22h", REG_BINARY, NULL, 0, 0); verify_reg(hkey, "Wine22i", REG_NONE, NULL, 0, 0);
- RegCloseKey(hkey); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -894,8 +901,7 @@ static void test_basic_import_unicode(void) ""Wine\\31"="Test value"\n\n"); open_key(hkey, "Subkey"1", 0, &subkey); verify_reg(subkey, "Wine\31", REG_SZ, "Test value", 11, 0); - lr = RegCloseKey(subkey); - ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + close_key(subkey); delete_key(HKEY_CURRENT_USER, KEY_BASE "\Subkey"1");
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -903,8 +909,7 @@ static void test_basic_import_unicode(void) ""123/\"4;'5"="Random value name"\n\n"); open_key(hkey, "Subkey/2", 0, &subkey); verify_reg(subkey, "123/"4;'5", REG_SZ, "Random value name", 18, 0); - lr = RegCloseKey(subkey); - ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + close_key(subkey); delete_key(HKEY_CURRENT_USER, KEY_BASE "\Subkey/2");
/* Test the accepted range of the hex-based data types */ @@ -1085,7 +1090,7 @@ static void test_basic_import_unicode(void) verify_reg(hkey, "Wine22h", REG_BINARY, NULL, 0, 0); verify_reg(hkey, "Wine22i", REG_NONE, NULL, 0, 0);
- RegCloseKey(hkey); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -1147,7 +1152,7 @@ static void test_basic_import_31(void) "HKEY_CLASSES_ROOT\" KEY_BASE " = No newline"); verify_reg(hkey, "", REG_SZ, "No newline", 11, 0);
- RegCloseKey(hkey); + close_key(hkey);
delete_key(HKEY_CLASSES_ROOT, KEY_BASE); } @@ -1652,7 +1657,7 @@ static void test_invalid_import(void) verify_reg_nonexist(hkey, "Wine33e"); verify_reg_nonexist(hkey, "Wine33f");
- RegCloseKey(hkey); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -2163,7 +2168,7 @@ static void test_invalid_import_unicode(void) verify_reg_nonexist(hkey, "Wine33e"); verify_reg_nonexist(hkey, "Wine33f");
- RegCloseKey(hkey); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -2217,7 +2222,7 @@ static void test_invalid_import_31(void) "Hkey_Classes_Root\" KEY_BASE " = Value3c\r\n"); verify_reg_nonexist(hkey, "");
- RegCloseKey(hkey); + close_key(hkey);
delete_key(HKEY_CLASSES_ROOT, KEY_BASE); } @@ -2455,7 +2460,7 @@ static void test_comments(void) " 61,74,69,6f,6e,00,00\n\n"); verify_reg_nonexist(hkey, "Wine29d");
- RegCloseKey(hkey); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -2695,7 +2700,7 @@ static void test_comments_unicode(void) " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n"); verify_reg_nonexist(hkey, "Wine29d");
- RegCloseKey(hkey); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -2703,7 +2708,6 @@ static void test_comments_unicode(void) static void test_import_with_whitespace(void) { HKEY hkey; - LONG lr; DWORD dword;
delete_tree(HKEY_CURRENT_USER, KEY_BASE); @@ -2842,8 +2846,7 @@ static void test_import_with_whitespace(void) " 61,74,69,6f,6e,00,00\n\n"); verify_reg(hkey, "Wine10b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- lr = RegCloseKey(hkey); - ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -2851,7 +2854,6 @@ static void test_import_with_whitespace(void) static void test_import_with_whitespace_unicode(void) { HKEY hkey; - LONG lr; DWORD dword;
delete_tree(HKEY_CURRENT_USER, KEY_BASE); @@ -2990,8 +2992,7 @@ static void test_import_with_whitespace_unicode(void) " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n"); verify_reg(hkey, "Wine10b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- lr = RegCloseKey(hkey); - ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -2999,7 +3000,6 @@ static void test_import_with_whitespace_unicode(void) static void test_key_creation_and_deletion(void) { HKEY hkey, subkey; - LONG lr;
delete_tree(HKEY_CURRENT_USER, KEY_BASE); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); @@ -3043,7 +3043,7 @@ static void test_key_creation_and_deletion(void) verify_key(hkey, "Subkey1e"); open_key(hkey, "Subkey1e", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); - RegCloseKey(subkey); + close_key(subkey); delete_key(hkey, "Subkey1e");
exec_import_str("REGEDIT4\n\n" @@ -3054,7 +3054,7 @@ static void test_key_creation_and_deletion(void) verify_key(hkey, "Subkey1f"); open_key(hkey, "Subkey1f\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); - RegCloseKey(subkey); + close_key(subkey); delete_key(hkey, "Subkey1f\\");
exec_import_str("REGEDIT4\n\n" @@ -3066,7 +3066,7 @@ static void test_key_creation_and_deletion(void) verify_key(hkey, "Subkey1g"); open_key(hkey, "Subkey1g\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); - RegCloseKey(subkey); + close_key(subkey); delete_key(hkey, "Subkey1g\\");
/* Test key deletion. We start by creating some registry keys. */ @@ -3130,8 +3130,7 @@ static void test_key_creation_and_deletion(void) verify_key_nonexist(hkey, "Subkey4b"); verify_reg_nonexist(hkey, "Wine1b");
- lr = RegCloseKey(hkey); - ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -3139,7 +3138,6 @@ static void test_key_creation_and_deletion(void) static void test_key_creation_and_deletion_unicode(void) { HKEY hkey, subkey; - LONG lr;
delete_tree(HKEY_CURRENT_USER, KEY_BASE); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE); @@ -3183,7 +3181,7 @@ static void test_key_creation_and_deletion_unicode(void) verify_key(hkey, "Subkey1e"); open_key(hkey, "Subkey1e", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); - RegCloseKey(subkey); + close_key(subkey); delete_key(hkey, "Subkey1e");
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -3194,7 +3192,7 @@ static void test_key_creation_and_deletion_unicode(void) verify_key(hkey, "Subkey1f"); open_key(hkey, "Subkey1f\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); - RegCloseKey(subkey); + close_key(subkey); delete_key(hkey, "Subkey1f\\");
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -3206,7 +3204,7 @@ static void test_key_creation_and_deletion_unicode(void) verify_key(hkey, "Subkey1g"); open_key(hkey, "Subkey1g\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); - RegCloseKey(subkey); + close_key(subkey); delete_key(hkey, "Subkey1g\\");
/* Test key deletion. We start by creating some registry keys. */ @@ -3270,8 +3268,7 @@ static void test_key_creation_and_deletion_unicode(void) verify_key_nonexist(hkey, "Subkey4b"); verify_reg_nonexist(hkey, "Wine1b");
- lr = RegCloseKey(hkey); - ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -3279,7 +3276,6 @@ static void test_key_creation_and_deletion_unicode(void) static void test_value_deletion(void) { HKEY hkey; - LONG lr; DWORD dword = 0x8; BYTE hex[4] = {0x11, 0x22, 0x33, 0x44};
@@ -3323,8 +3319,7 @@ static void test_value_deletion(void) verify_reg_nonexist(hkey, "Wine46e"); verify_reg(hkey, "Wine46f", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- lr = RegCloseKey(hkey); - ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -3333,7 +3328,6 @@ static void test_value_deletion(void) static void test_value_deletion_unicode(void) { HKEY hkey; - LONG lr; DWORD dword = 0x8; BYTE hex[4] = {0x11, 0x22, 0x33, 0x44};
@@ -3378,8 +3372,7 @@ static void test_value_deletion_unicode(void) verify_reg_nonexist(hkey, "Wine46e"); verify_reg(hkey, "Wine46f", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- lr = RegCloseKey(hkey); - ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); } @@ -3543,35 +3536,34 @@ static void test_export(void) add_key(hkey, "Subkey1", &subkey); add_value(subkey, "Binary", REG_BINARY, "\x11\x22\x33\x44", 4); add_value(subkey, "Undefined hex", 0x100, "%PATH%", 7); - RegCloseKey(subkey); + close_key(subkey);
add_key(hkey, "Subkey2a", &subkey); add_value(subkey, "double"quote", REG_SZ, ""Hello, World!"", 16); dword = 0x8; add_value(subkey, "single'quote", REG_DWORD, &dword, sizeof(dword)); - RegCloseKey(subkey); + close_key(subkey);
add_key(hkey, "Subkey2a\Subkey2b", &subkey); add_value(subkey, NULL, REG_SZ, "Default value name", 19); add_value(subkey, "Multiple strings", REG_MULTI_SZ, "Line1\0Line2\0Line3\0", 19); - RegCloseKey(subkey); + close_key(subkey);
add_key(hkey, "Subkey3a", &subkey); add_value(subkey, "Backslash", REG_SZ, "Use \\ to escape a backslash", 29); - RegCloseKey(subkey); + close_key(subkey);
add_key(hkey, "Subkey3a\Subkey3b\Subkey3c", &subkey); add_value(subkey, "String expansion", REG_EXPAND_SZ, "%HOME%\%PATH%", 14); add_value(subkey, "Zero data type", REG_NONE, "Value", 6); - RegCloseKey(subkey); + close_key(subkey);
add_key(hkey, "Subkey4", &subkey); dword = 0x12345678; add_value(subkey, NULL, REG_DWORD, &dword, sizeof(dword)); add_value(subkey, "43981", 0xabcd, "Value", 6); - RegCloseKey(subkey); - - RegCloseKey(hkey); + close_key(subkey); + close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", complex_test, 0), "compare_export() failed\n"); @@ -3582,9 +3574,9 @@ static void test_export(void) /* Test the export order of registry keys */ add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey); add_key(hkey, "Subkey2", &subkey); - RegCloseKey(subkey); + close_key(subkey); add_key(hkey, "Subkey1", &subkey); - RegCloseKey(subkey); + close_key(subkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n"); @@ -3597,8 +3589,7 @@ static void test_export(void) */ add_value(hkey, "Value 2", REG_SZ, "I was added first!", 19); add_value(hkey, "Value 1", REG_SZ, "I was added second!", 20); - - RegCloseKey(hkey); + close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", value_order_test, TODO_REG_COMPARE), "compare_export() failed\n"); @@ -3615,7 +3606,7 @@ static void test_export(void) add_value(hkey, "Wine1f", REG_MULTI_SZ, NULL, 0); add_value(hkey, "Wine1g", 0x100, NULL, 0); add_value(hkey, "Wine1h", 0xabcd, NULL, 0); - RegCloseKey(hkey); + close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n"); @@ -3632,7 +3623,7 @@ static void test_export(void) verify_reg(hkey, "Wine2a", REG_SZ, NULL, 0, 0); verify_reg(hkey, "Wine2b", REG_BINARY, NULL, 0, 0); verify_reg(hkey, "Wine2c", REG_DWORD, NULL, 0, 0); - RegCloseKey(hkey); + close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n"); @@ -3651,7 +3642,7 @@ static void test_export(void) verify_reg(hkey, "Wine3b", REG_BINARY, hex, 4, 0); dword = 0x10203040; verify_reg(hkey, "Wine3c", REG_DWORD, &dword, sizeof(dword), 0); - RegCloseKey(hkey); + close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n"); @@ -3680,7 +3671,7 @@ static void test_export(void) verify_reg(hkey, "Wine4f", REG_SZ, "\0Value", 7, 0); verify_reg(hkey, "Wine4g", REG_SZ, "Value2", 7, 0); verify_reg(hkey, "Wine4h", REG_SZ, "abc\0def", 8, 0); - RegCloseKey(hkey); + close_key(hkey);
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=85959
Your paranoid android.
=== w7u_adm (32 bit report) ===
regedit.exe: regedit: Timeout
=== w8adm (32 bit report) ===
regedit.exe: regedit: Timeout
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/regedit/tests/regedit.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index 7e84c4c9a2f..ad9e0a2bffb 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -492,7 +492,7 @@ static void test_basic_import(void) open_key(hkey, "Subkey"1", 0, &subkey); verify_reg(subkey, "Wine\31", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE "\Subkey"1"); + delete_key(hkey, "Subkey"1");
exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "\Subkey/2]\n" @@ -500,7 +500,7 @@ static void test_basic_import(void) open_key(hkey, "Subkey/2", 0, &subkey); verify_reg(subkey, "123/"4;'5", REG_SZ, "Random value name", 18, 0); close_key(subkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE "\Subkey/2"); + delete_key(hkey, "Subkey/2");
/* Test the accepted range of the hex-based data types */ exec_import_str("REGEDIT4\n\n" @@ -902,7 +902,7 @@ static void test_basic_import_unicode(void) open_key(hkey, "Subkey"1", 0, &subkey); verify_reg(subkey, "Wine\31", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE "\Subkey"1"); + delete_key(hkey, "Subkey"1");
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\" KEY_BASE "\Subkey/2]\n" @@ -910,7 +910,7 @@ static void test_basic_import_unicode(void) open_key(hkey, "Subkey/2", 0, &subkey); verify_reg(subkey, "123/"4;'5", REG_SZ, "Random value name", 18, 0); close_key(subkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE "\Subkey/2"); + delete_key(hkey, "Subkey/2");
/* Test the accepted range of the hex-based data types */ exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -3424,7 +3424,6 @@ error:
static void test_export(void) { - LONG lr; HKEY hkey, subkey; DWORD dword; BYTE hex[4]; @@ -3567,9 +3566,7 @@ static void test_export(void)
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", complex_test, 0), "compare_export() failed\n"); - - lr = delete_tree(HKEY_CURRENT_USER, KEY_BASE); - ok(lr == ERROR_SUCCESS, "delete_tree() failed: %d\n", lr); + delete_tree(HKEY_CURRENT_USER, KEY_BASE);
/* Test the export order of registry keys */ add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey); @@ -3580,7 +3577,6 @@ static void test_export(void)
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n"); - delete_key(hkey, "Subkey1"); delete_key(hkey, "Subkey2");
@@ -3593,7 +3589,6 @@ static void test_export(void)
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", value_order_test, TODO_REG_COMPARE), "compare_export() failed\n"); - delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with empty hex data */ @@ -3610,7 +3605,6 @@ static void test_export(void)
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n"); - delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export after importing alternative registry data types */ @@ -3627,7 +3621,6 @@ static void test_export(void)
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n"); - delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Test registry export with embedded null characters */ @@ -3646,7 +3639,6 @@ static void test_export(void)
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n"); - delete_key(HKEY_CURRENT_USER, KEY_BASE);
exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -3675,7 +3667,6 @@ static void test_export(void)
run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=85960
Your paranoid android.
=== w7u_adm (32 bit report) ===
regedit.exe: regedit: Timeout
=== w8adm (32 bit report) ===
regedit.exe: regedit: Timeout
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/regedit/tests/regedit.c | 34 ++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index ad9e0a2bffb..34acd18228b 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -1649,7 +1649,7 @@ static void test_invalid_import(void) ""Wine33c"="Value1\0\n" ""Wine33d"="Value2\0\0\0\0\n" ""Wine33e"="Value3\0Value4\n" - ""Wine33f"="\0Value4\n\n"); + ""Wine33f"="\0Value5\n\n"); verify_reg_nonexist(hkey, "Wine33a"); verify_reg_nonexist(hkey, "Wine33b"); verify_reg_nonexist(hkey, "Wine33c"); @@ -1657,6 +1657,21 @@ static void test_invalid_import(void) verify_reg_nonexist(hkey, "Wine33e"); verify_reg_nonexist(hkey, "Wine33f");
+ exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\" KEY_BASE "]\n" + ""Wine34a"="\0"\n" + ""Wine34b"="\0\0"\n" + ""Wine34c"="Value1\0"\n" + ""Wine34d"="Value2\0\0\0\0"\n" + ""Wine34e"="Value3\0Value4"\n" + ""Wine34f"="\0Value5"\n\n"); + todo_wine verify_reg_nonexist(hkey, "Wine34a"); + todo_wine verify_reg_nonexist(hkey, "Wine34b"); + todo_wine verify_reg_nonexist(hkey, "Wine34c"); + todo_wine verify_reg_nonexist(hkey, "Wine34d"); + todo_wine verify_reg_nonexist(hkey, "Wine34e"); + todo_wine verify_reg_nonexist(hkey, "Wine34f"); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE); @@ -2160,7 +2175,7 @@ static void test_invalid_import_unicode(void) ""Wine33c"="Value1\0\n" ""Wine33d"="Value2\0\0\0\0\n" ""Wine33e"="Value3\0Value4\n" - ""Wine33f"="\0Value4\n\n"); + ""Wine33f"="\0Value5\n\n"); verify_reg_nonexist(hkey, "Wine33a"); verify_reg_nonexist(hkey, "Wine33b"); verify_reg_nonexist(hkey, "Wine33c"); @@ -2168,6 +2183,21 @@ static void test_invalid_import_unicode(void) verify_reg_nonexist(hkey, "Wine33e"); verify_reg_nonexist(hkey, "Wine33f");
+ exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\" KEY_BASE "]\n" + ""Wine34a"="\0"\n" + ""Wine34b"="\0\0"\n" + ""Wine34c"="Value1\0"\n" + ""Wine34d"="Value2\0\0\0\0"\n" + ""Wine34e"="Value3\0Value4"\n" + ""Wine34f"="\0Value5"\n\n"); + todo_wine verify_reg_nonexist(hkey, "Wine34a"); + todo_wine verify_reg_nonexist(hkey, "Wine34b"); + todo_wine verify_reg_nonexist(hkey, "Wine34c"); + todo_wine verify_reg_nonexist(hkey, "Wine34d"); + todo_wine verify_reg_nonexist(hkey, "Wine34e"); + todo_wine verify_reg_nonexist(hkey, "Wine34f"); + close_key(hkey);
delete_key(HKEY_CURRENT_USER, KEY_BASE);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=85961
Your paranoid android.
=== w7u_adm (32 bit report) ===
regedit.exe: regedit: Timeout
=== w8adm (32 bit report) ===
regedit.exe: regedit: Timeout
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/regedit/tests/regedit.c | 43 ++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index 34acd18228b..f9c12afb880 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -677,9 +677,19 @@ static void test_basic_import(void) verify_reg(hkey, "Wine22h", REG_BINARY, NULL, 0, 0); verify_reg(hkey, "Wine22i", REG_NONE, NULL, 0, 0);
+ /* Test forward and back slashes */ + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\" KEY_BASE "]\n" + ""count/up"="one/two/three"\n" + ""\\foo\\bar"=""\n\n" + "[HKEY_CURRENT_USER\" KEY_BASE "\https://winehq.org%5D%5Cn%5Cn"); + verify_reg(hkey, "count/up", REG_SZ, "one/two/three", 14, 0); + verify_reg(hkey, "\foo\bar", REG_SZ, "", 1, 0); + verify_key(hkey, "https://winehq.org"); + close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); }
static void test_basic_import_unicode(void) @@ -1090,9 +1100,19 @@ static void test_basic_import_unicode(void) verify_reg(hkey, "Wine22h", REG_BINARY, NULL, 0, 0); verify_reg(hkey, "Wine22i", REG_NONE, NULL, 0, 0);
+ /* Test forward and back slashes */ + exec_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\" KEY_BASE "]\n" + ""count/up"="one/two/three"\n" + ""\\foo\\bar"=""\n\n" + "[HKEY_CURRENT_USER\" KEY_BASE "\https://winehq.org%5D%5Cn%5Cn"); + verify_reg(hkey, "count/up", REG_SZ, "one/two/three", 14, 0); + verify_reg(hkey, "\foo\bar", REG_SZ, "", 1, 0); + verify_key(hkey, "https://winehq.org"); + close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); }
static void test_basic_import_31(void) @@ -3544,6 +3564,13 @@ static void test_export(void) ""Wine4g"="Value2"\r\n" ""Wine4h"="abc"\r\n\r\n";
+ const char *slashes_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_CURRENT_USER\" KEY_BASE "]\r\n" + ""count/up"="one/two/three"\r\n" + ""\\foo\\bar"=""\r\n\r\n" + "[HKEY_CURRENT_USER\" KEY_BASE "\https://winehq.org%5D%5Cr%5Cn%5Cr%5Cn"; + delete_tree(HKEY_CURRENT_USER, KEY_BASE); verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
@@ -3698,6 +3725,18 @@ static void test_export(void) run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n"); delete_key(HKEY_CURRENT_USER, KEY_BASE); + + /* Test registry export with forward and back slashes */ + add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey); + add_key(hkey, "https://winehq.org", &subkey); + close_key(subkey); + add_value(hkey, "count/up", REG_SZ, "one/two/three", 14); + add_value(hkey, "\foo\bar", REG_SZ, "", 1); + close_key(hkey); + + run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\" KEY_BASE); + ok(compare_export("file.reg", slashes_test, TODO_REG_COMPARE), "compare_export() failed\n"); + delete_tree(HKEY_CURRENT_USER, KEY_BASE); }
START_TEST(regedit)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=85962
Your paranoid android.
=== w7u_adm (32 bit report) ===
regedit.exe: regedit: Timeout
=== w8adm (32 bit report) ===
regedit.exe: regedit: Timeout
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=85957
Your paranoid android.
=== w7u_adm (32 bit report) ===
regedit.exe: regedit: Timeout
=== w8adm (32 bit report) ===
regedit.exe: regedit: Timeout