Received: from eggs.gnu.org ([2001:4830:134:3::10]:47716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJfsf-00053F-96 for qemu-devel@nongnu.org; Tue, 19 Aug 2014 05:39:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJfsY-0000DM-3M for qemu-devel@nongnu.org; Tue, 19 Aug 2014 05:39:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJfsX-0000D9-Rj for qemu-devel@nongnu.org; Tue, 19 Aug 2014 05:38:58 -0400 Date: Tue, 19 Aug 2014 10:38:54 +0100 From: Stefan Hajnoczi Message-ID: <20140819093854.GB25538@stefanha-thinkpad.redhat.com> References: <1408399224-9834-1-git-send-email-maria.k@catit.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UHN/qo2QbUvPLonB" Content-Disposition: inline In-Reply-To: <1408399224-9834-1-git-send-email-maria.k@catit.be> Subject: Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maria Kustova Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, Maria Kustova --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 19, 2014 at 02:00:24AM +0400, Maria Kustova wrote: > diff --git a/tests/image-fuzzer/qcow2/fuzz.py b/tests/image-fuzzer/qcow2/= fuzz.py > index 6e272c6..c652dc9 100644 > --- a/tests/image-fuzzer/qcow2/fuzz.py > +++ b/tests/image-fuzzer/qcow2/fuzz.py > @@ -123,7 +123,7 @@ def string_validator(current, strings): > return validator(current, random.choice, strings) > =20 > =20 > -def selector(current, constraints, validate=3Dint_validator): > +def selector(current, constraints, validate=3DNone): > """Select one value from all defined by constraints. > =20 > Each constraint produces one random value satisfying to it. The func= tion > @@ -131,6 +131,9 @@ def selector(current, constraints, validate=3Dint_val= idator): > constraints overlaps). > """ > =20 > + if validate is None: > + validate =3D int_validator > + > def iter_validate(c): > """Apply validate() only to constraints represented as lists. > =20 I don't understand the benefit of this change. The default initializer syntax did what was intended, now it has been made more complicated with a None value that gets converted to int_validator later. --UHN/qo2QbUvPLonB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT8xsuAAoJEJykq7OBq3PI2vgH/jYPtlZdUGy9wtkfHjk7RRzz y4d+C0ayFMkgB18tyl/PZ2BnT8RrBrqLiENQ8ZG9xoxG/Hf10gU9dCZFMtbJqG9I LZtWz93bYC/aryd/l2YrmfD+7HoiO/ZfvyfzKScSMPpjGvtAEVafk1X3dQHaVSDg 7JQoa8hF8/vGQLAs6Q3c5jzq9DVdTC+8pILcEjylZVjMpQrytp6WT2vjeWfOWFdW qlg7rZ/6g1WeDKNhjep/s1Sh8Ic5Y8PuID+40SeN/a9f5m5M1SVAz2sXleGeNrCn jA/vTUN8j5W/cHk5+CW96WfPPHUw9zxND4iGYn0hV1b5OIWbFtHCFUNyjtLhODc= =angT -----END PGP SIGNATURE----- --UHN/qo2QbUvPLonB--