From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfbXd-0006wk-K2 for qemu-devel@nongnu.org; Fri, 25 Sep 2015 18:32:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfbXa-0005eY-Eq for qemu-devel@nongnu.org; Fri, 25 Sep 2015 18:32:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfbXa-0005eO-AO for qemu-devel@nongnu.org; Fri, 25 Sep 2015 18:32:30 -0400 References: <1442872682-6523-1-git-send-email-eblake@redhat.com> <1442872682-6523-6-git-send-email-eblake@redhat.com> <87a8sbga01.fsf@blackfin.pond.sub.org> <56041E2A.1070509@redhat.com> <87612zbx2h.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <5605CB76.3090009@redhat.com> Date: Fri, 25 Sep 2015 16:32:22 -0600 MIME-Version: 1.0 In-Reply-To: <87612zbx2h.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="A9vRBCiSHBs7BfXPsJFkmx59kFgl180Hs" Subject: Re: [Qemu-devel] [PATCH v5 05/46] qapi: Test use of 'number' within alternates List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Michael Roth , marcandre.lureau@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com, DirtY.iCE.hu@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --A9vRBCiSHBs7BfXPsJFkmx59kFgl180Hs Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/24/2015 10:29 AM, Markus Armbruster wrote: >>>> + >>>> + /* FIXME: Order of alternate should not affect semantics */ >>> >>> Inhowfar does it affect semantics? Or asked differently: what exactl= y >>> is wrong with this test now? >>> >>>> + v =3D visitor_input_test_init(data, "42"); >>>> + visit_type_AltThree(v, &three, NULL, &error_abort); >>>> + g_assert_cmpint(three->kind, =3D=3D, ALT_THREE_KIND_N); >>>> + g_assert_cmpfloat(three->n, =3D=3D, 42); >>>> + qapi_free_AltThree(three); >>>> + one =3D NULL; >> >> >> AltTwo and AltThree are ostensibly the same struct (two branches, one >> for 'str' and one for 'number', just in a different order), but they >> parsed differently (AltTwo failed, AltThree succeeded). The bug is >> fixed later when the order of the branch declaration no longer impacts= >> the result of the parse. >=20 > Then nothing is wrong with this test case, and the FIXME doesn't belong= > here. Actually, the test for AltThree succeeds only by accident. There are two bugs at play; when I fix the first bug (order shouldn't matter: AltTwo and AltThree should parse identically), then the second bug is finally exposed (integers aren't being parsed as numbers, in either AltTwo or AltThree). But I can certainly rework the FIXMEs both here and on the first fix (19/46) to make it more obvious what the second fix (20/46) is good for. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --A9vRBCiSHBs7BfXPsJFkmx59kFgl180Hs 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/ iQEcBAEBCAAGBQJWBct2AAoJEKeha0olJ0NqJKgH/ikJptLbHx8eT7MVNQFaTRfZ ZB+yWO6UpO1B44AMp22I7EeGaOI41JLBp3sBePYnFSjxPJJJyv1Igkbk6FyoARSn mFivAtH9JX6je7kxIq2bnTuuB24P4AUWLqnUqK/HN0UshdwvlYZ7e0bWeooycRf3 7mXewSpnSr8AKxsueKEo2Gh2T7itO5CTDZ+2kqmatoNLPb8c5Jl4rEqzTBTKo5+B Fb35NQSfo07EGA5+iW4vu7CcZ0aYpBJ78I/BRf8/XhIyguu8tH9BVP64sqPAv7E1 9oo2VNTt5tvMv+9kSWMuCMRE8mp9OEwEJVApy4EoYLXmmYebZtJR+jPEuJ2pLKQ= =Qb2M -----END PGP SIGNATURE----- --A9vRBCiSHBs7BfXPsJFkmx59kFgl180Hs--