From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcxTO-0002TP-MI for qemu-devel@nongnu.org; Fri, 18 Sep 2015 11:21:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcxTJ-0004tV-Qu for qemu-devel@nongnu.org; Fri, 18 Sep 2015 11:21:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcxTJ-0004rL-Jd for qemu-devel@nongnu.org; Fri, 18 Sep 2015 11:21:09 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 252C26E for ; Fri, 18 Sep 2015 15:21:09 +0000 (UTC) References: <1442573994-14632-1-git-send-email-marcandre.lureau@redhat.com> <1442573994-14632-2-git-send-email-marcandre.lureau@redhat.com> <55FC282B.2080304@redhat.com> <292263729.13770446.1442589049347.JavaMail.zimbra@redhat.com> From: Eric Blake Message-ID: <55FC2BE4.8050001@redhat.com> Date: Fri, 18 Sep 2015 09:21:08 -0600 MIME-Version: 1.0 In-Reply-To: <292263729.13770446.1442589049347.JavaMail.zimbra@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8uLNQKpKNQsljF05EMjVQR8lE8kiNuxGe" Subject: Re: [Qemu-devel] [PATCH v2 2/4] tests: add some qemu_strtosz() tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: marcandre lureau , qemu-devel@nongnu.org, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8uLNQKpKNQsljF05EMjVQR8lE8kiNuxGe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/18/2015 09:10 AM, Marc-Andr=C3=A9 Lureau wrote: > Hi >=20 > ----- Original Message ----- >> On 09/18/2015 04:59 AM, marcandre.lureau@redhat.com wrote: >>> From: Marc-Andr=C3=A9 Lureau >>> >>> While reading the function I decided to write some tests. >>> >>> Signed-off-by: Marc-Andr=C3=A9 Lureau >>> Reviewed-by: Eric Blake >>> --- >>> tests/test-cutils.c | 91 >>> +++++++++++++++++++++++++++++++++++++++++++++++++++++ >>> 1 file changed, 91 insertions(+) >> >> I accepted v1 because it was better than no tests at all, but did make= >> some suggestions for additional tests to perform. I'm surprised you >> didn't include any of those suggestions in v2. For example, it would = be >> nice if the testsuite documents a contract on what happens with a bogu= s >> suffix: is "1234x" outright rejected, or does it parse as "1234" leavi= ng >> the pointer at 'x'? >=20 > I thought you were ok with this patch as is. If there was no other reason for a respin. But once you are doing a respin, you might as well consider it, or at least document after the --- that you at least thought about it and had a reason for not doing it.= > But I can add some failing tests if you want (although it feels like te= sting strtod() at this point. Not quite. strtod() doesn't parse suffixes, but does consume input anyways; it then requires the user to do post-processing (so by itself it is not an easy contract). The whole point of writing our own wrapper is so that we can have sane semantics without the caller having to do post-processing. That should include a sane contract for what we do on a suffix we don't recognize is useful. In particular, there could be arguments for both "parse as much as possible", and for "refuse to parse anything that has trailing garbage"; and since I don't know which way it currently is, it means we SHOULD be making it part of the contract and giving it some testing. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --8uLNQKpKNQsljF05EMjVQR8lE8kiNuxGe 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/ iQEcBAEBCAAGBQJV/CvkAAoJEKeha0olJ0NqfAYIAImHOgVuDFoLdaWoj+QdQdMN D/DR2H058Ya5GZCdezPH5DhMgfKEUDPSP/aiNrg2+km9DrRRKSp19K7wQhJlnQHZ GiyDPAb5hnyjohYXoiSM9LImC0Kp5PBfowIH6aHfmjoAwSDiS3Xt153VaNFAHPMF KYV8X/ZSjyhdsPKg4SplC0igyv9bQ/vFRJN1hYUO3kslR+L6oBIAWfQPimJMRI5R w+bjhiYp7UCBrMPmL3jsviyX9fU3cN40M9MEZEnJarhiJiohpYdAPSTiTls0BpC1 mrn5l4cwDfvzsNPiPSWsnyKu8L70S23f2zwXUXrfMbljqMQlCl1araUTjhc2rUQ= =jI8w -----END PGP SIGNATURE----- --8uLNQKpKNQsljF05EMjVQR8lE8kiNuxGe--