diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2019-07-11 16:05:06 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2019-07-23 15:53:25 +0100 |
commit | 601b5575e245d1d5bb3633d2422674e6da23f7d0 (patch) | |
tree | 28a77597a9d0d1199e96797bb5d25e2d60244fa8 /tests/migration-test.c | |
parent | 56e89a310b2b1f68bddf642b7609a9bfde6bd265 (diff) |
tests/migration-test: don't spam the logs when we fail
Quite often the information about which test failed is hidden by the
wall of repeated failures for each page. Stop outputting the error
after 10 bad pages and just summarise the total damage at the end.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Diffstat (limited to 'tests/migration-test.c')
-rw-r--r-- | tests/migration-test.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/migration-test.c b/tests/migration-test.c index a4feb9545d..c1968740ab 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -308,7 +308,7 @@ static void check_guests_ram(QTestState *who) uint8_t first_byte; uint8_t last_byte; bool hit_edge = false; - bool bad = false; + int bad = 0; qtest_memread(who, start_address, &first_byte, 1); last_byte = first_byte; @@ -327,15 +327,20 @@ static void check_guests_ram(QTestState *who) hit_edge = true; last_byte = b; } else { - fprintf(stderr, "Memory content inconsistency at %x" - " first_byte = %x last_byte = %x current = %x" - " hit_edge = %x\n", - address, first_byte, last_byte, b, hit_edge); - bad = true; + bad++; + if (bad <= 10) { + fprintf(stderr, "Memory content inconsistency at %x" + " first_byte = %x last_byte = %x current = %x" + " hit_edge = %x\n", + address, first_byte, last_byte, b, hit_edge); + } } } } - g_assert_false(bad); + if (bad >= 10) { + fprintf(stderr, "and in another %d pages", bad - 10); + } + g_assert(bad == 0); } static void cleanup(const char *filename) |