Followup of 13c77bc9e6.
[Test pattern page](https://test.winehq.org/data/patterns.html#kernel32:console)
[Testbot run with this patch](https://testbot.winehq.org/JobDetails.pl?Key=158074)
-- v2: kernel32/tests: Skip FreeConsole test at Windows 7.
From: Bernhard Übelacker bernhardu@mailbox.org
Followup of 13c77bc9e6. --- dlls/kernel32/tests/console.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 398b818776a..fa839a8d79d 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -4279,6 +4279,11 @@ static void test_FreeConsole(HANDLE input, HANDLE orig_output) ret = WaitForSingleObject(output, 0); ok(!ret, "got %d\n", ret); ret = WaitForSingleObject(unbound_output, 0); + if (broken(ret == -1)) /* Win7 */ + { + win_skip("Skip test on Win7\n"); + goto cleanup; + } ok(!ret, "got %d\n", ret); ret = WaitForSingleObject(unbound_input, 0); ok(!ret, "got %d\n", ret); @@ -4487,6 +4492,7 @@ static void test_FreeConsole(HANDLE input, HANDLE orig_output) todo_wine ok(!SetConsoleCtrlHandler(mydummych, FALSE), "FreeConsole() should have reset ctrl handlers' list\n");
+cleanup: CloseHandle(unbound_input); CloseHandle(unbound_output); CloseHandle(output);
v2: - Skip test based on return value from WaitForSingleObject instead of the GetProcAddress.
Eh, that's what skip_nt is supposed to be for, I just didn't pay enough attention to realize it would be necessary for the new tests as well.
On Tue Apr 29 16:24:50 2025 +0000, Elizabeth Figura wrote:
Eh, that's what skip_nt is supposed to be for, I just didn't pay enough attention to realize it would be necessary for the new tests as well.
Thanks for looking at it, so would be early leaving test_FreeConsole like in this [testbot run](https://testbot.winehq.org/JobDetails.pl?Key=158110) the way to go?
Or would you like the few tests above the `WaitForSingleObject(unbound_output` still to be run?
On Tue Apr 29 16:24:50 2025 +0000, Bernhard Übelacker wrote:
Thanks for looking at it, so would be early leaving test_FreeConsole like in this [testbot run](https://testbot.winehq.org/JobDetails.pl?Key=158110) the way to go? Or would you like the few tests above the `WaitForSingleObject(unbound_output` still to be run?
actually no for the ctrl handlers test at the bottom of the function
logic of the test is: set ctrl-handler, freeconsole, ctrl handlers should have been removed by FreeConsole (there's a symetrical test for AllocConsole)
Zeb's patch introduced a couple of console creation/deletion in between setting / testing the ctrl handlers, weakening the test (ie fixing only allocconsole would let the test pass)
now we'd bail out for Win7 while it should (could at least) be tested
doesn't look simple to mix both tests, so perhaps splitting them is the way to go