qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formattin


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements
Date: Tue, 19 Aug 2014 10:38:54 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

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)
>  
>  
> -def selector(current, constraints, validate=int_validator):
> +def selector(current, constraints, validate=None):
>      """Select one value from all defined by constraints.
>  
>      Each constraint produces one random value satisfying to it. The function
> @@ -131,6 +131,9 @@ def selector(current, constraints, 
> validate=int_validator):
>      constraints overlaps).
>      """
>  
> +    if validate is None:
> +        validate = int_validator
> +
>      def iter_validate(c):
>          """Apply validate() only to constraints represented as lists.
>  

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.

Attachment: pgpmNR0M51LZn.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]