summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-03-08 15:37:29 +0000
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:49:36 -0600
commit6c2c65279a17e8f1b72f2ba1b0eeeaa156759189 (patch)
tree43b29ec5ca3fc3fcac12e0d23752337fcc03c715
parent506315bc33837167a9bfed6eae5ac4c588f4a6a3 (diff)
downloadhqemu-6c2c65279a17e8f1b72f2ba1b0eeeaa156759189.zip
hqemu-6c2c65279a17e8f1b72f2ba1b0eeeaa156759189.tar.gz
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: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rw-r--r--tests/io-channel-helpers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/io-channel-helpers.c b/tests/io-channel-helpers.c
index d513792..a4dedbe 100644
--- a/tests/io-channel-helpers.c
+++ b/tests/io-channel-helpers.c
@@ -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);
OpenPOWER on IntegriCloud