Commit c19f3b62 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

conhost: Fix tests on ReadConsole with CONSOLE_READCONSOLE_CONTROL.

It should fix the errors around line 1370 in conhost/tests/tty.c, but it doesn't fix other errors around line 1530 and 1550 which are completly unrelated to this change. So failures to be expected on the latter. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52648Signed-off-by: 's avatarEric Pouech <eric.pouech@gmail.com>
parent 627f2b35
......@@ -1337,6 +1337,9 @@ static void test_read_console_control(void)
/* test simple behavior */
for (ctrl = 0; ctrl < ' '; ctrl++)
{
DWORD state;
SHORT cc;
/* don't play with fire */
if (ctrl == 0 || ctrl == 3 || ctrl == '\n' || ctrl == 27) continue;
......@@ -1359,10 +1362,13 @@ static void test_read_console_control(void)
strcpy(buf, "def."); buf[3] = ctrl;
write_console_pipe(buf);
wcscpy(bufw, L"abcdef."); bufw[6] = (WCHAR)ctrl;
child_expect_read_control_result(child_pipe, bufw,
(ctrl == '\t' || ctrl == '\r') ? 0
: ((ctrl == 30 || ctrl == 31) ? (LEFT_CTRL_PRESSED | SHIFT_PRESSED)
: LEFT_CTRL_PRESSED));
/* ^H requires special handling */
cc = (ctrl == 8) ? 0x0200 : VkKeyScanA(ctrl);
if (cc == -1) cc = 0;
state = 0;
if (cc & 0x0100) state |= SHIFT_PRESSED;
if (cc & 0x0200) state |= LEFT_CTRL_PRESSED;
child_expect_read_control_result(child_pipe, bufw, state);
skip_sequence("\x1b[?25l"); /* hide cursor */
expect_output_sequence("def");
skip_sequence("\x1b[?25h"); /* show cursor */
......
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