[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 07/18] io: assert errors before asserting content
From: |
Daniel P. Berrange |
Subject: |
[Qemu-devel] [PATCH v2 07/18] io: assert errors before asserting content in I/O test |
Date: |
Thu, 10 Mar 2016 17:26:54 +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.
Reviewed-by: Paolo Bonzini <address@hidden>
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
- [Qemu-devel] [PATCH v2 00/18] Multiple fixes & improvements to QIOChannel & Win32, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 01/18] osdep: fix socket_error() to work with Mingw64, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 03/18] io: initialize sockets in test program, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 02/18] io: use bind() to check for IPv4/6 availability, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 06/18] io: set correct error object in background reader test thread, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 07/18] io: assert errors before asserting content in I/O test,
Daniel P. Berrange <=
- [Qemu-devel] [PATCH v2 05/18] io: wait for incoming client in socket test, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 04/18] io: bind to socket before creating QIOChannelSocket, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 12/18] io: remove checking of EWOULDBLOCK, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 08/18] io: fix copy+paste mistake in socket error message, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 09/18] io: pass HANDLE to g_source_add_poll on Win32, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 11/18] io: use qemu_accept to ensure SOCK_CLOEXEC is set, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 13/18] io: implement socket watch for win32 using WSAEventSelect+select, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 10/18] io: introduce qio_channel_create_socket_watch, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 14/18] char: remove qemu_chr_finish_socket_connection method, Daniel P. Berrange, 2016/03/10
- [Qemu-devel] [PATCH v2 16/18] char: remove qemu_chr_open_socket_fd method, Daniel P. Berrange, 2016/03/10