Skip to content
Snippets Groups Projects
Commit 294bbbb4 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé
Browse files

io: assert errors before asserting content in I/O test


When checking the results of an I/O operation test, assert that
the error objects are NULL before asserting on the content. This
is found to give more useful indication of the problem when
diagnosing test failures.

Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
parent 256920eb
No related branches found
No related tags found
No related merge requests found
......@@ -233,11 +233,11 @@ void qio_channel_test_run_reader(QIOChannelTest *test,
void qio_channel_test_validate(QIOChannelTest *test)
{
g_assert(test->readerr == NULL);
g_assert(test->writeerr == NULL);
g_assert_cmpint(memcmp(test->input,
test->output,
test->len), ==, 0);
g_assert(test->readerr == NULL);
g_assert(test->writeerr == NULL);
g_free(test->inputv);
g_free(test->outputv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment