Received: from eggs.gnu.org ([2001:4830:134:3::10]:51381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzQAc-00075d-Dz for qemu-devel@nongnu.org; Wed, 26 Oct 2016 11:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzQAZ-0002ag-Pa for qemu-devel@nongnu.org; Wed, 26 Oct 2016 11:31:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50230) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzQAZ-0002aV-GE for qemu-devel@nongnu.org; Wed, 26 Oct 2016 11:31:11 -0400 References: <1477323383-12380-1-git-send-email-eblake@redhat.com> <1477323383-12380-3-git-send-email-eblake@redhat.com> <87twc03cwx.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <834b3d98-6008-a1d2-a021-b021e8f87d7f@redhat.com> Date: Wed, 26 Oct 2016 10:31:08 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="n2raDs4DCahGsF0sfAm4vWkkqXXiTEl6r" Subject: Re: [Qemu-devel] [PATCH 2/2] tests: Enhance qmp output to cover partial visit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: ptoscano@redhat.com, qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --n2raDs4DCahGsF0sfAm4vWkkqXXiTEl6r From: Eric Blake To: Markus Armbruster Cc: ptoscano@redhat.com, qemu-devel@nongnu.org, Michael Roth Message-ID: <834b3d98-6008-a1d2-a021-b021e8f87d7f@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] tests: Enhance qmp output to cover partial visit References: <1477323383-12380-1-git-send-email-eblake@redhat.com> <1477323383-12380-3-git-send-email-eblake@redhat.com> <87twc03cwx.fsf@dusky.pond.sub.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/25/2016 08:41 AM, Eric Blake wrote: >>> +static void test_visitor_out_partial_visit(TestOutputVisitorData *da= ta, >>> + const void *unused) >>> +{ >>> + /* Check that aborting mid-visit doesn't leak or double-free */ >>> + visit_start_struct(data->ov, NULL, NULL, 0, &error_abort); >>> + visit_start_struct(data->ov, "nested", NULL, 0, &error_abort); >>> + visitor_reset(data); >> >> Add a second test that additionally visits a member? Or is visiting t= he >> "nested" member enough? >=20 > Visiting "nested" was enough to trigger the particular valgrind trace I= > wanted, but more coverage never hurts. I'll send v2... >=20 >> Would you be willing to do the same for lists and alternates? >=20 > ...and it will also cover these. Aborting in the middle of an alternate is trickier, since the current code for alternates does not allow a non-NULL *obj to visit_start_alternate() (that is, no virtual alternate walk is needed; to output an alternate, just call directly to the branch of interest, without a need to wrap things in visit_start/end_alternate; and on input, an alternate is currently useful only into a QAPI C struct). >=20 >> >> Speaking of alternates, visitor.h's virtual walk example covers struct= >> and list, but not alternate. >=20 > Sounds like my v2 will be a longer series :) I'm still trying to see whether tweaking the docs to cover alternates makes much sense; we'll see what the patch looks like, but may decide it was not worth it. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --n2raDs4DCahGsF0sfAm4vWkkqXXiTEl6r Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYEMw8AAoJEKeha0olJ0Nqtm8IAKkCtAh5TDMi2ZPZerhs6EJf hCFcQxDIea4tfZ4tQPgMjlN5xQYIFmE5L6J3NLmbzwRScAYJm9AouyfAlvT4qpmN 07EJugBkoe2DSYIR6+/wxwEwYenm46glkLDy/ceIyrmRQg3/NPyq9TzhDbuvCx0c K8ycNY+z08do6pivFn92sXut0paSYYIADG8RspGXo7IJNsl61gRNvQrYe7D13ZAO T9JJHUPbz1dryq1CtF0GQKOiSuBpEt4RFrTVmIygV4nj/bwLhIZGfTnCis/I7VAw WujOd8IhOwuQQSmsbNkAar+CiBj2H4L08q/EigPDEV5nYEj8idR/4x1z2czuIBc= =W9S6 -----END PGP SIGNATURE----- --n2raDs4DCahGsF0sfAm4vWkkqXXiTEl6r--