Commit d350af24 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

kernel32/tests: Test GetConsoleOriginalTitleW() with an empty title.

parent 30f1c1be
......@@ -4283,6 +4283,15 @@ static void test_GetConsoleOriginalTitleW(void)
ok(ret == title_len, "got %lu, expected %lu\n", ret, title_len);
}
static void test_GetConsoleOriginalTitleW_empty(void)
{
WCHAR buf[64];
DWORD ret;
ret = GetConsoleOriginalTitleW(buf, ARRAY_SIZE(buf));
ok(!ret, "GetConsoleOriginalTitleW failed: %lu\n", GetLastError());
}
static void test_GetConsoleOriginalTitle(void)
{
STARTUPINFOA si = { sizeof(si) };
......@@ -4299,6 +4308,14 @@ static void test_GetConsoleOriginalTitle(void)
CloseHandle(info.hThread);
wait_child_process(info.hProcess);
CloseHandle(info.hProcess);
strcat(buf, " empty");
title[0] = 0;
ret = CreateProcessA(NULL, buf, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &info);
ok(ret, "CreateProcess failed: %lu\n", GetLastError());
CloseHandle(info.hThread);
wait_child_process(info.hProcess);
CloseHandle(info.hProcess);
}
static void test_GetConsoleTitleA(void)
......@@ -4944,10 +4961,15 @@ START_TEST(console)
ExitProcess(exit_code);
}
if (argc == 3 && !strcmp(argv[2], "title_test"))
if (argc >= 3 && !strcmp(argv[2], "title_test"))
{
test_GetConsoleOriginalTitleA();
test_GetConsoleOriginalTitleW();
if (argc == 3)
{
test_GetConsoleOriginalTitleA();
test_GetConsoleOriginalTitleW();
}
else
test_GetConsoleOriginalTitleW_empty();
return;
}
......
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