From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1OYP-0004XP-1d for qemu-devel@nongnu.org; Mon, 22 Jul 2013 18:26:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1OYO-0003Pi-4R for qemu-devel@nongnu.org; Mon, 22 Jul 2013 18:26:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1OYN-0003PZ-Kw for qemu-devel@nongnu.org; Mon, 22 Jul 2013 18:26:04 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6MMQ3Og030047 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Jul 2013 18:26:03 -0400 Message-ID: <51EDB17A.7020206@redhat.com> Date: Mon, 22 Jul 2013 16:26:02 -0600 From: Eric Blake MIME-Version: 1.0 References: <1374527256-27631-1-git-send-email-lersek@redhat.com> <1374527256-27631-9-git-send-email-lersek@redhat.com> <51EDAC5F.1070001@redhat.com> <51EDB12A.7020704@redhat.com> In-Reply-To: <51EDB12A.7020704@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NlKsJ0TKMHffnWogtCr4t6vmFPno4Gnrx" Subject: Re: [Qemu-devel] [PATCH 8/8] OptsVisitor: introduce unit tests, with test cases for range flattening List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NlKsJ0TKMHffnWogtCr4t6vmFPno4Gnrx Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/22/2013 04:24 PM, Laszlo Ersek wrote: >> Pretty thorough, although I thought of a couple other ideas to test: >> i64=3D5z-6 should fail; i64=3D5-6-7 should fail >=20 > I can add them if you insist, but I wrote (and single-stepped all of) > the test cases so that all branches added by patches 3, 5 and 6 would b= e > covered. (Some of the final tests in this function are actually > redundant, but I liked how they looked :)) >=20 > For example, "i64=3D5z-6" is no different from "i64=3D5z", in patch 3 b= oth > the first added (*endptr =3D=3D '\0') condition and the (*endptr =3D=3D= '-') > fail the same way for both input strings: we never look past the "z". >=20 > Likewise, "i64=3D5-6-7" is the same case as "i64=3D5-6z": both characte= rs > after the "6" (ie. "-" and "z") violate the second added (*endptr =3D=3D= > '\0') condition in patch 3 the same way. >=20 > Do you accept this argument? :) Yes, I can agree you have 100% code coverage as currently coded. Adding what currently forms redundant cases may avoid future patch-writers from breaking 100% coverage while actually triggering different paths between the cases; but at the same time, we can assume such a future patch-writer would be adding some new feature to the parser, and could expand the testsuite accordingly as part of their efforts. So no, I won't insist on a respin :) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NlKsJ0TKMHffnWogtCr4t6vmFPno4Gnrx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR7bF6AAoJEKeha0olJ0Nq2L0IAIUcehCjYRzeihso7BSwKUG+ SPx5NoolrK3ht0e8owgooW5fovVn6i42knfxL6Nnn3B3LFK7dUY4uvnwuavoe7Aa DtQucIssy0VeMxGf7PaBZWB+8bymKL8BnPMTxoauKurZWKoZKlFEEpSVhkMmNOnJ xT8Swr7Tb9Fn+txEkkEvgFgMvQMJCyDWfX1/mOv5hHiNszUyByaUyVh2EMVJmZ24 VZqRK/acREv9IyR4mS85BX7mq5JyYnyY8Um3FA0p/UEd9Noaxz2fuuk4eAEKKGYt 9Y+CuZE1trtjE6+xCSZaT/3OPUt6MLGDY5AjB78MZYPmTh0pQff0VE6zh4Kyads= =7QU8 -----END PGP SIGNATURE----- --NlKsJ0TKMHffnWogtCr4t6vmFPno4Gnrx--