qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 3/3] tests: start generic qemu-qmp tests


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v4 3/3] tests: start generic qemu-qmp tests
Date: Thu, 29 Sep 2016 18:28:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Marc-André Lureau <address@hidden> writes:

> These 2 tests exhibit two qmp bugs fixed by the previous patches.

No objections to having QMP tests, but the ones fixed by PATCH 2 are QMP
input visitor bugs, which sneaked through the existing
test-qmp-input-visitor.c.  Makes me suspect we should close the test
coverage hole there.  The appended patch narrowly exercises one of the
two bugs.  No good, we should test all the visit_type_FOO() rather than
just visit_type_any().  I can do that, breaks the tedium of patch review
:)

[...]


diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c
index f583dce..11f55ac 100644
--- a/tests/test-qmp-input-visitor.c
+++ b/tests/test-qmp-input-visitor.c
@@ -237,6 +237,7 @@ static void test_visitor_in_any(TestInputVisitorData *data,
                                 const void *unused)
 {
     QObject *res = NULL;
+    Error *err = NULL;
     Visitor *v;
     QInt *qint;
     QBool *qbool;
@@ -271,6 +272,12 @@ static void test_visitor_in_any(TestInputVisitorData *data,
     g_assert(qstring);
     g_assert_cmpstr(qstring_get_str(qstring), ==, "foo");
     qobject_decref(res);
+
+    v = visitor_input_test_init(data, "{}");
+    visit_start_struct(v, NULL, NULL, 0, &error_abort);
+    visit_type_any(v, "any", &res, &err);
+    error_free_or_abort(&err);
+    visit_end_struct(v, NULL);
 }
 
 static void test_visitor_in_null(TestInputVisitorData *data,



reply via email to

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