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) ...@@ -1337,6 +1337,9 @@ static void test_read_console_control(void)
/* test simple behavior */ /* test simple behavior */
for (ctrl = 0; ctrl < ' '; ctrl++) for (ctrl = 0; ctrl < ' '; ctrl++)
{ {
DWORD state;
SHORT cc;
/* don't play with fire */ /* don't play with fire */
if (ctrl == 0 || ctrl == 3 || ctrl == '\n' || ctrl == 27) continue; if (ctrl == 0 || ctrl == 3 || ctrl == '\n' || ctrl == 27) continue;
...@@ -1359,10 +1362,13 @@ static void test_read_console_control(void) ...@@ -1359,10 +1362,13 @@ static void test_read_console_control(void)
strcpy(buf, "def."); buf[3] = ctrl; strcpy(buf, "def."); buf[3] = ctrl;
write_console_pipe(buf); write_console_pipe(buf);
wcscpy(bufw, L"abcdef."); bufw[6] = (WCHAR)ctrl; wcscpy(bufw, L"abcdef."); bufw[6] = (WCHAR)ctrl;
child_expect_read_control_result(child_pipe, bufw, /* ^H requires special handling */
(ctrl == '\t' || ctrl == '\r') ? 0 cc = (ctrl == 8) ? 0x0200 : VkKeyScanA(ctrl);
: ((ctrl == 30 || ctrl == 31) ? (LEFT_CTRL_PRESSED | SHIFT_PRESSED) if (cc == -1) cc = 0;
: LEFT_CTRL_PRESSED)); 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 */ skip_sequence("\x1b[?25l"); /* hide cursor */
expect_output_sequence("def"); expect_output_sequence("def");
skip_sequence("\x1b[?25h"); /* show cursor */ 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