]> Git Repo - qemu.git/blobdiff - tests/io-channel-helpers.c
tests: virtio-9p: add walk operation test
[qemu.git] / tests / io-channel-helpers.c
index 844066904bb1251b06d8ade8cc392f0860c92366..05e5579cf8f8663d6c1d4226f0acefb6709754d0 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "io-channel-helpers.h"
+#include "qapi/error.h"
 
 struct QIOChannelTest {
     QIOChannel *src;
@@ -132,7 +133,7 @@ static gpointer test_io_thread_reader(gpointer opaque)
 
         if (ret == QIO_CHANNEL_ERR_BLOCK) {
             if (data->blocking) {
-                error_setg(&data->writeerr,
+                error_setg(&data->readerr,
                            "Unexpected I/O blocking");
                 break;
             } else {
@@ -233,11 +234,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);
This page took 0.02456 seconds and 4 git commands to generate.