Piotr Caban : ucrtbase: Test child process exit code.

Alexandre Julliard julliard at winehq.org
Mon Jul 9 16:00:35 CDT 2018


Module: wine
Branch: master
Commit: 27de76e3df6b276c25eddb9788d509797f45d422
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=27de76e3df6b276c25eddb9788d509797f45d422

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Jul  9 18:03:19 2018 +0200

ucrtbase: Test child process exit code.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ucrtbase/tests/misc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c
index 1c56f73..99b9fd2 100644
--- a/dlls/ucrtbase/tests/misc.c
+++ b/dlls/ucrtbase/tests/misc.c
@@ -782,7 +782,12 @@ static void test_exit(const char *argv0)
     sprintf(path, "%s misc exit", argv0);
     startup.cb = sizeof(startup);
     CreateProcessA(NULL, path, NULL, NULL, TRUE, 0, NULL, NULL, &startup, &proc);
-    winetest_wait_child_process(proc.hProcess);
+    ret = WaitForSingleObject(proc.hProcess, INFINITE);
+    ok(ret == WAIT_OBJECT_0, "child process wait failed\n");
+    GetExitCodeProcess(proc.hProcess, &ret);
+    ok(ret == 1, "child process exited with code %d\n", ret);
+    CloseHandle(proc.hProcess);
+    CloseHandle(proc.hThread);
 
     ret = WaitForSingleObject(exit_event, 0);
     ok(ret == WAIT_OBJECT_0, "exit_event was not set (%x)\n", ret);
@@ -812,7 +817,7 @@ static void test_call_exit(void)
 {
     ok(!p__crt_atexit(at_exit_func1), "_crt_atexit failed\n");
     ok(!p__crt_atexit(at_exit_func2), "_crt_atexit failed\n");
-    p_exit(0);
+    p_exit(1);
 }
 
 START_TEST(misc)




More information about the wine-cvs mailing list