kernel32/tests: Break debugger loop on unexpected result.

Avoid infinite loop that sometimes happen on macOS and make the test
spew hundred of thousand of "Test failed" lines.
This commit is contained in:
Rémi Bernon 2024-06-18 11:22:44 +02:00 committed by Alexandre Julliard
parent 299490ed7b
commit 6cb63e996e

View file

@ -2190,8 +2190,10 @@ static void test_debugger(const char *argv0)
{
next_event(&ctx, WAIT_EVENT_TIMEOUT);
ok (ctx.ev.dwDebugEventCode != EXCEPTION_DEBUG_EVENT, "got exception\n");
if (ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT) break;
}
while (ctx.ev.dwDebugEventCode != EXIT_PROCESS_DEBUG_EVENT);
if (ctx.ev.dwDebugEventCode != EXIT_PROCESS_DEBUG_EVENT) TerminateProcess(pi.hProcess, 0);
ret = CloseHandle(event);
ok(ret, "CloseHandle failed, last error %ld.\n", GetLastError());