From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztet1-0001si-JE for qemu-devel@nongnu.org; Tue, 03 Nov 2015 11:56:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ztesw-0007ng-JD for qemu-devel@nongnu.org; Tue, 03 Nov 2015 11:56:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztesw-0007na-BC for qemu-devel@nongnu.org; Tue, 03 Nov 2015 11:56:38 -0500 References: <1446052473-19170-1-git-send-email-eblake@redhat.com> <1446052473-19170-10-git-send-email-eblake@redhat.com> <87pozr3ufr.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <5638E73D.8010607@redhat.com> Date: Tue, 3 Nov 2015 09:56:29 -0700 MIME-Version: 1.0 In-Reply-To: <87pozr3ufr.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="49NfDV9p5vTMNOWE54BqC3NtP3aHqNfn8" Subject: Re: [Qemu-devel] [PATCH v8 09/17] qapi: Add positive tests to qapi-schema-test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --49NfDV9p5vTMNOWE54BqC3NtP3aHqNfn8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/03/2015 09:43 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Add positive tests to qapi-schema-test for things that were >> made possible by recent patches but which caused compile errors >> due to collisions prior to that point. >> >> This includes: >> Use of a member 'base' in a struct with a base class >> Use of a member name ending in 'Kind' or 'List' >> Use of a type name starting with 'has_' >> Use of a type named 'u' >> Use of a union branch name of 'u' >> Use of a union branch name starting with 'has_' >> Use of a union branch name of 'type' >> >> Signed-off-by: Eric Blake >> >> --- >> v8: new, but collects portions of subset B v10 patches 2, 3, and >> 16 and subset C v7 patch 6 that were deferred to later. >> >> It might be worth dropping or simplifying this patch, depending >> on how many corner cases we actually want to test. >=20 > Let's go through your list: >=20 > * Use of a member 'base' in a struct with a base class >=20 > 'base' is no longer special, and testing it is as useful as testing > any other non-special member name. I'd drop it. Or am I missing > something? Broken prior to commit ddf2190, and no reservation exists. I don't mind dropping it, especially since it quite distinct from the other grouping of collision testing. >=20 > * Use of a member name ending in 'Kind' or 'List' >=20 > These aren't special as member names, but they are reserved type > names. The test ensures we don't accidentally reserve them as member= > names. Low probability * low damage =3D very low risk. But since yo= u > wrote the test already, we can just as well keep it. >=20 > * Use of a type name starting with 'has_' > * Use of a type named 'u' Never have been broken, but this adds insurance that we don't break it (and that our reservations added earlier aren't too greedy). > * Use of a union branch name of 'u' Broken prior to commit e4ba22b3; also proves that the reservation in 5359baf is not too greedy. > * Use of a union branch name starting with 'has_' Broken prior to commit e4ba22b3; also proves that the reservation in 9fb081e is not too greedy. >=20 > Similarly: these are only reserved as member names, very low risk, bu= t > why not keep the test. >=20 > * Use of a union branch name of 'type' Broken prior to commit e4ba22b3. Doesn't have a reservation, so... >=20 > As far as I know, 'type' isn't reserved anywhere, it's just the name > of a simple union's implicit tag member. Testing a tag value doesn't= > clash with 'type' is as useful as testing any other non-variant membe= r > name. I'd drop it. Or am I missing something? =2E..I could indeed drop this part of the test, on the same grounds as dropping the 'base' non-collision tests. >=20 > Anything else being tested here? >=20 I think that covers it. There's also one more positive test added in 10/17, when I rework the layout of alternate types (at that point, it is possible to have an alternate branch named 'max' because it no longer collides with a generated enum _MAX value). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --49NfDV9p5vTMNOWE54BqC3NtP3aHqNfn8 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/ iQEcBAEBCAAGBQJWOOc9AAoJEKeha0olJ0NqD2MIAIPVwTy3BWaeQ0gfVBIFXiq3 aELurb0Arx63iUzvNvwRarmNdAHDenOWZEtAAreBB27/drD7+lRrgkBQbOGOgtUi pekAZpkafEutjqzobDQf2tLcBXHtor01KjHQG80a5tmetPi+zvwt1evMywN6P28U tykeGVh6iD8mY1yBTF5F7nF2EhrpwR+xe+9R+Z50j8/gOULgpwrMFITbUU3rnfUL 5+QF/Ybr7HvBby/apgsfWJo3KJS9LKbmUh1T3GLdgatvW6dP88/Sx6M8vAkrsZd4 i4WJqCLLgbb/920kTK81Te3WS5J9v9V5e4rkIwDTqPqbSjsAXpc6Ospz+3dU3Uc= =ht0K -----END PGP SIGNATURE----- --49NfDV9p5vTMNOWE54BqC3NtP3aHqNfn8--