Signed-off-by: Torge Matthies openglfreak@googlemail.com --- dlls/kernel32/tests/console.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 9195ac204f7..8a995ca36db 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -4723,6 +4723,11 @@ static BOOL check_same_console(const char* exec, DWORD flags) return check_subprocess(exec, buf, flags); }
+static BOOL check_has_window(const char* exec, DWORD flags) +{ + return check_subprocess(exec, "check_console_has_window", flags); +} + static void test_CreateProcessCUI(void) { char guiexec[MAX_PATH]; @@ -4751,6 +4756,17 @@ static void test_CreateProcessCUI(void) res = check_same_console(cuiexec, CREATE_NO_WINDOW|CREATE_NEW_CONSOLE); ok(!res, "Expected child to be attached to a different console\n");
+ res = check_has_window(cuiexec, 0); + ok(res, "Expected child to have a console window\n"); + res = check_has_window(cuiexec, DETACHED_PROCESS); + ok(!res, "Expected child to not have a console window\n"); + res = check_has_window(cuiexec, CREATE_NO_WINDOW); + todo_wine ok(!res, "Expected child to not have a console window\n"); + res = check_has_window(cuiexec, CREATE_NO_WINDOW|DETACHED_PROCESS); + ok(!res, "Expected child to not have a console window\n"); + res = check_has_window(cuiexec, CREATE_NO_WINDOW|CREATE_NEW_CONSOLE); + ok(res, "Expected child to have a console window\n"); + FreeConsole();
res = check_whether_child_attached(guiexec, DETACHED_PROCESS); @@ -4816,6 +4832,11 @@ START_TEST(console) ExitProcess(0); }
+ if (argc == 3 && !strcmp(argv[2], "check_console_has_window")) + { + ExitProcess(IsWindow(GetConsoleWindow())); + } + test_current = argc >= 3 && !strcmp(argv[2], "--current"); using_pseudo_console = argc >= 3 && !strcmp(argv[2], "--pseudo-console");