Module: wine Branch: master Commit: b632f0966d5a51f85e791b990493ec46864972de URL: http://source.winehq.org/git/wine.git/?a=commit;h=b632f0966d5a51f85e791b9904...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Apr 18 17:44:43 2013 +0900
kernel32: Count precise amount of child process failures.
---
dlls/kernel32/tests/loader.c | 30 +++++++++++++++++++++++++----- include/wine/test.h | 7 +++++++ 2 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index ca33ef7..20ae3ec 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -1615,7 +1615,11 @@ static void test_ExitProcess(void) ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); GetExitCodeProcess(pi.hProcess, &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.hProcess);
@@ -1628,7 +1632,11 @@ static void test_ExitProcess(void) ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); GetExitCodeProcess(pi.hProcess, &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.hProcess);
@@ -1641,7 +1649,11 @@ static void test_ExitProcess(void) ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); GetExitCodeProcess(pi.hProcess, &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.hProcess);
@@ -1654,7 +1666,11 @@ static void test_ExitProcess(void) ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); GetExitCodeProcess(pi.hProcess, &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.hProcess);
@@ -1668,7 +1684,11 @@ static void test_ExitProcess(void) GetExitCodeProcess(pi.hProcess, &ret); todo_wine 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.hProcess);
diff --git a/include/wine/test.h b/include/wine/test.h index 0bd4db5..373fe76 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -61,6 +61,7 @@ extern int winetest_loop_todo(void); extern void winetest_end_todo( const char* platform ); extern int winetest_get_mainargs( char*** pargv ); extern LONG winetest_get_failures(void); +extern void winetest_add_failures( LONG new_failures ); extern void winetest_wait_child_process( HANDLE process );
extern const char *wine_dbgstr_wn( const WCHAR *str, int n ); @@ -434,6 +435,12 @@ LONG winetest_get_failures(void) return failures; }
+void winetest_add_failures( LONG new_failures ) +{ + while (new_failures-- > 0) + InterlockedIncrement( &failures ); +} + void winetest_wait_child_process( HANDLE process ) { DWORD exit_code = 1;