Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/reg/tests/add.c | 2 +- programs/reg/tests/copy.c | 2 +- programs/reg/tests/export.c | 2 +- programs/reg/tests/import.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/programs/reg/tests/add.c b/programs/reg/tests/add.c index bdfd429367c..bd0888ae831 100644 --- a/programs/reg/tests/add.c +++ b/programs/reg/tests/add.c @@ -630,7 +630,7 @@ START_TEST(add) DWORD r;
if (!run_reg_exe("reg.exe /?", &r)) { - win_skip("reg.exe not available, skipping reg.exe tests\n"); + win_skip("reg.exe not available, skipping 'add' tests\n"); return; }
diff --git a/programs/reg/tests/copy.c b/programs/reg/tests/copy.c index b91352c9d46..a8956d7e9a0 100644 --- a/programs/reg/tests/copy.c +++ b/programs/reg/tests/copy.c @@ -102,7 +102,7 @@ START_TEST(copy) DWORD r;
if (!run_reg_exe("reg.exe /?", &r)) { - win_skip("reg.exe not available, skipping reg.exe tests\n"); + win_skip("reg.exe not available, skipping 'copy' tests\n"); return; }
diff --git a/programs/reg/tests/export.c b/programs/reg/tests/export.c index e03b1f3db25..9a3f7d5fbf0 100644 --- a/programs/reg/tests/export.c +++ b/programs/reg/tests/export.c @@ -408,7 +408,7 @@ START_TEST(export) DWORD r;
if (!run_reg_exe("reg.exe /?", &r)) { - win_skip("reg.exe not available, skipping reg.exe tests\n"); + win_skip("reg.exe not available, skipping 'export' tests\n"); return; }
diff --git a/programs/reg/tests/import.c b/programs/reg/tests/import.c index 5b520f11d5f..f769e0020f5 100644 --- a/programs/reg/tests/import.c +++ b/programs/reg/tests/import.c @@ -3584,7 +3584,7 @@ START_TEST(import) DWORD r;
if (!run_reg_exe("reg.exe /?", &r)) { - win_skip("reg.exe not available, skipping 'query' tests\n"); + win_skip("reg.exe not available, skipping 'import' tests\n"); return; }
The existing check fails to adequately determine the program's elevation status on systems where the test key already exists. This can cause all Windows 3.1 import tests to fail on systems with a standard user account.
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/reg/tests/import.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/programs/reg/tests/import.c b/programs/reg/tests/import.c index f769e0020f5..58831625fa5 100644 --- a/programs/reg/tests/import.c +++ b/programs/reg/tests/import.c @@ -3468,25 +3468,34 @@ static void test_import_win31(void) { LONG err; HKEY hkey; - DWORD dispos, r; + DWORD r;
/* Check if reg.exe is running with elevated privileges */ - err = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_READ|KEY_SET_VALUE, NULL, &hkey, &dispos); + err = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE); if (err == ERROR_ACCESS_DENIED) { win_skip("reg.exe is not running with elevated privileges; " "skipping Windows 3.1 import tests\n"); return; } - - if (dispos == REG_OPENED_EXISTING_KEY) - delete_value(hkey, NULL); + if (err == ERROR_FILE_NOT_FOUND) + { + if (RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_READ, NULL, &hkey, NULL)) + { + win_skip("reg.exe is not running with elevated privileges; " + "skipping Windows 3.1 import tests\n"); + return; + } + RegCloseKey(hkey); + RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE); + }
/* Test simple value */ test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\" KEY_BASE " = Value0\r\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + open_key(HKEY_CLASSES_ROOT, KEY_BASE, KEY_SET_VALUE, &hkey); verify_reg(hkey, "", REG_SZ, "Value0", 7, 0);
/* Test proper handling of spaces and equals signs */
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=86276
Your paranoid android.
=== debiant2 (32 bit report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (32 bit French report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (32 bit Japanese:Japan report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (32 bit Chinese:China report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (32 bit WoW report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (64 bit WoW report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
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=86275
Your paranoid android.
=== debiant2 (32 bit report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (32 bit French report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (32 bit Japanese:Japan report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (32 bit Chinese:China report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (32 bit WoW report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add
=== debiant2 (64 bit WoW report) ===
Report validation errors: reg.exe:import contains a misplaced todo message for add