qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v1 07/21] io: assert errors before asserting content


From: Daniel P. Berrange
Subject: [Qemu-devel] [PATCH v1 07/21] io: assert errors before asserting content in I/O test
Date: Wed, 9 Mar 2016 17:28:10 +0000

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.

Signed-off-by: Daniel P. Berrange <address@hidden>
---
 tests/io-channel-helpers.c | 4 ++--
 1 file 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);
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]