Received: from eggs.gnu.org ([2001:4830:134:3::10]:58401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpeCF-0007IC-JB for qemu-devel@nongnu.org; Thu, 29 Sep 2016 12:28:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpeCA-0005aF-GS for qemu-devel@nongnu.org; Thu, 29 Sep 2016 12:28:30 -0400 From: Markus Armbruster References: <20160922203927.28241-1-marcandre.lureau@redhat.com> <20160922203927.28241-4-marcandre.lureau@redhat.com> Date: Thu, 29 Sep 2016 18:28:23 +0200 In-Reply-To: <20160922203927.28241-4-marcandre.lureau@redhat.com> (=?utf-8?Q?=22Marc-Andr=C3=A9?= Lureau"'s message of "Fri, 23 Sep 2016 00:39:27 +0400") Message-ID: <87k2du4qmw.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 3/3] tests: start generic qemu-qmp tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Cc: qemu-devel@nongnu.org, paolo.bonzini@gmail.com, qemu-stable@nongnu.org Marc-Andr=C3=A9 Lureau 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 *d= ata, const void *unused) { QObject *res =3D NULL; + Error *err =3D 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), =3D=3D, "foo"); qobject_decref(res); + + v =3D 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); } =20 static void test_visitor_in_null(TestInputVisitorData *data,