Commit b632f096 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

kernel32: Count precise amount of child process failures.

parent 3de89e85
...@@ -1615,7 +1615,11 @@ static void test_ExitProcess(void) ...@@ -1615,7 +1615,11 @@ static void test_ExitProcess(void)
ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n");
GetExitCodeProcess(pi.hProcess, &ret); GetExitCodeProcess(pi.hProcess, &ret);
ok(ret == 195, "expected exit code 195, got %u\n", ret); ok(ret == 195, "expected exit code 195, got %u\n", ret);
ok(!*child_failures, "%u failures in child process\n", *child_failures); if (*child_failures)
{
trace("%d failures in child process\n", *child_failures);
winetest_add_failures(*child_failures);
}
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
...@@ -1628,7 +1632,11 @@ static void test_ExitProcess(void) ...@@ -1628,7 +1632,11 @@ static void test_ExitProcess(void)
ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n");
GetExitCodeProcess(pi.hProcess, &ret); GetExitCodeProcess(pi.hProcess, &ret);
ok(ret == 195, "expected exit code 195, got %u\n", ret); ok(ret == 195, "expected exit code 195, got %u\n", ret);
ok(!*child_failures, "%u failures in child process\n", *child_failures); if (*child_failures)
{
trace("%d failures in child process\n", *child_failures);
winetest_add_failures(*child_failures);
}
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
...@@ -1641,7 +1649,11 @@ static void test_ExitProcess(void) ...@@ -1641,7 +1649,11 @@ static void test_ExitProcess(void)
ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n");
GetExitCodeProcess(pi.hProcess, &ret); GetExitCodeProcess(pi.hProcess, &ret);
ok(ret == 197, "expected exit code 197, got %u\n", ret); ok(ret == 197, "expected exit code 197, got %u\n", ret);
ok(!*child_failures, "%u failures in child process\n", *child_failures); if (*child_failures)
{
trace("%d failures in child process\n", *child_failures);
winetest_add_failures(*child_failures);
}
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
...@@ -1654,7 +1666,11 @@ static void test_ExitProcess(void) ...@@ -1654,7 +1666,11 @@ static void test_ExitProcess(void)
ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n");
GetExitCodeProcess(pi.hProcess, &ret); GetExitCodeProcess(pi.hProcess, &ret);
ok(ret == 195, "expected exit code 195, got %u\n", ret); ok(ret == 195, "expected exit code 195, got %u\n", ret);
ok(!*child_failures, "%u failures in child process\n", *child_failures); if (*child_failures)
{
trace("%d failures in child process\n", *child_failures);
winetest_add_failures(*child_failures);
}
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
...@@ -1668,7 +1684,11 @@ static void test_ExitProcess(void) ...@@ -1668,7 +1684,11 @@ static void test_ExitProcess(void)
GetExitCodeProcess(pi.hProcess, &ret); GetExitCodeProcess(pi.hProcess, &ret);
todo_wine todo_wine
ok(ret == 0 || broken(ret == 195) /* before win7 */, "expected exit code 0, got %u\n", ret); ok(ret == 0 || broken(ret == 195) /* before win7 */, "expected exit code 0, got %u\n", ret);
ok(!*child_failures, "%u failures in child process\n", *child_failures); if (*child_failures)
{
trace("%d failures in child process\n", *child_failures);
winetest_add_failures(*child_failures);
}
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
......
...@@ -61,6 +61,7 @@ extern int winetest_loop_todo(void); ...@@ -61,6 +61,7 @@ extern int winetest_loop_todo(void);
extern void winetest_end_todo( const char* platform ); extern void winetest_end_todo( const char* platform );
extern int winetest_get_mainargs( char*** pargv ); extern int winetest_get_mainargs( char*** pargv );
extern LONG winetest_get_failures(void); extern LONG winetest_get_failures(void);
extern void winetest_add_failures( LONG new_failures );
extern void winetest_wait_child_process( HANDLE process ); extern void winetest_wait_child_process( HANDLE process );
extern const char *wine_dbgstr_wn( const WCHAR *str, int n ); extern const char *wine_dbgstr_wn( const WCHAR *str, int n );
...@@ -434,6 +435,12 @@ LONG winetest_get_failures(void) ...@@ -434,6 +435,12 @@ LONG winetest_get_failures(void)
return failures; return failures;
} }
void winetest_add_failures( LONG new_failures )
{
while (new_failures-- > 0)
InterlockedIncrement( &failures );
}
void winetest_wait_child_process( HANDLE process ) void winetest_wait_child_process( HANDLE process )
{ {
DWORD exit_code = 1; DWORD exit_code = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment