[igt-dev] [PATCH igt] igt/drv_hangman: Check that the error state does hold the expected state
Chris Wilson
chris at chris-wilson.co.uk
Sat Mar 3 10:50:58 UTC 2018
Actually check the error state exists (!"No error state captured") and
that it contains the expected engine dump.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
tests/drv_hangman.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index 38cb20c3..65f3ea1f 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -129,6 +129,10 @@ static void check_error_state(const char *expected_ring_name,
FILE *file = open_error();
char *line = NULL;
size_t line_size = 0;
+ bool found = false;
+
+ getline(&line, &line_size, file);
+ igt_assert(strcasecmp(line, "No error state captured"));
while (getline(&line, &line_size, file) > 0) {
char *dashes;
@@ -168,12 +172,16 @@ static void check_error_state(const char *expected_ring_name,
4*i, batch[i]);
igt_assert(strstr(line, expected_line));
}
+
+ found = true;
break;
}
}
free(line);
fclose(file);
+
+ igt_assert(found);
}
static void test_error_state_capture(unsigned ring_id,
--
2.16.2
More information about the igt-dev
mailing list