From 9317a331f1d4c39f5da391f976c2cb98f1d3e0fe Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Wed, 26 Oct 2022 15:36:42 +0200 Subject: [PATCH] conhost/tests: Fix some conditions on tty test termination. Signed-off-by: Eric Pouech --- programs/conhost/tests/tty.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/programs/conhost/tests/tty.c b/programs/conhost/tests/tty.c index 5befbd2ea82..9371d0ce6f5 100644 --- a/programs/conhost/tests/tty.c +++ b/programs/conhost/tests/tty.c @@ -1858,6 +1858,16 @@ static void test_pseudoconsole(void) if (i != 39) expect_output_sequence("\r\n"); } skip_sequence("\x1b[H\x1b[?25h"); + /* native sometimes redraws the screen afterwards */ + if (skip_sequence("\x1b[25l")) + { + unsigned int line_feed = 0; + /* not checking exact output, depends too heavily on previous tests */ + for (i = 0; i < console_output_count - 2; i++) + if (!memcmp(console_output + i, "\r\n", 2)) line_feed++; + ok(line_feed == 39, "Wrong number of line feeds %u\n", line_feed); + console_output_count = 0; + } } expect_empty_output();