On Wed, May 15, 2013 at 03:39:10PM +0200, Helga Velroyen wrote:
> This patch introduces and enhances generators for
> instances:
> - 'genInstWithNets' is split into the generation of an
>   arbitrary instance and enhancing an instance with nets
> - 'genInst' calls 'genInstWithNets' with an empty set
>   of initial networks to provide a reasonable default
> - the Arbitrary instance of 'Instance' uses now 'genDisks'
>   to create instances with a reasonable set of disks
> 
> Signed-off-by: Helga Velroyen <[email protected]>
> ---
>  test/hs/Test/Ganeti/Objects.hs | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/test/hs/Test/Ganeti/Objects.hs b/test/hs/Test/Ganeti/Objects.hs
> index da4a89d..46b31b9 100644
> --- a/test/hs/Test/Ganeti/Objects.hs
> +++ b/test/hs/Test/Ganeti/Objects.hs
> @@ -34,6 +34,7 @@ module Test.Ganeti.Objects
>    , genDisk
>    , genDiskWithChildren
>    , genEmptyCluster
> +  , genInst
>    , genInstWithNets
>    , genValidNetwork
>    , genBitStringMaxLen
> @@ -127,7 +128,7 @@ instance Arbitrary Instance where
>        -- nics
>        <*> arbitrary
>        -- disks
> -      <*> arbitrary
> +      <*> vectorOf 5 genDisk

Here we have another magic constant, and, as opposed to the
3 in the first patch, it is not even mentioned in the commit
message where it comes from. Do we need an "arbitrary small number"?

Your decision though. LGTM.


-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Katherine Stephens

Reply via email to