Ticket #109 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Quickcheck tests pass with quickcheck1, fail with quickcheck2.

Reported by: erikd Owned by: erikd
Priority: blocker Milestone:
Component: Unknown Version: 0.1.2
Keywords: Cc:

Description

On Linux x86_64, bin/ddc --test results in

 * rotate_inv                               +++ OK, passed 100 tests.
 * eachAndOthers_total                      +++ OK, passed 100 tests.
 * chopOnLeft_inv                           *** Gave up! Passed only 13 tests.
 * chopOnRight_inv                          *** Gave up! Passed only 13 tests.
 * breakOns_inv                             *** Gave up! Passed only 13 tests.
 * fromBackNodes_coverage                   *** Failed! Exception: 'stack overflow' (after 28 tests):

BackGraph (fromList [(-1022,BackNode [-995,632,750,-252,811,-174,-476,212,791,542,-, .....

With the rest of the BackGraph dump being over a megabyte in size.

Using ghc-6.10.4, compiled from a Debian source package on Ubuntu 9.04.

Change History

Changed 5 years ago by erikd

Hmm, the failure above was when using QuickCheck version 2.1.0.1. When using version 1.2.0.0 all tests pass.

 * rotate_inv                               OK, passed 100 tests.
 * eachAndOthers_total                      OK, passed 100 tests.
 * chopOnLeft_inv                           OK, passed 100 tests.
 * chopOnRight_inv                          OK, passed 100 tests.
 * breakOns_inv                             OK, passed 100 tests.
 * fromBackNodes_coverage                   OK, passed 100 tests.

Changed 5 years ago by erikd

  • version set to 0.1.2

Changed 5 years ago by erikd

  • owner set to erikd
  • status changed from new to assigned
  • summary changed from Quickcheck failures on linux x86_64 to Quickcheck tests pass with quickcheck1, fail with quickcheck2.

Changed 5 years ago by erikd

The first part of this bug has been fixed in the following commit:

Thu Feb 4 21:13:03 EST 2010 Erik de Castro Lopo <erikd@…>

Fixes for Quickcheck2 (partial fix for #109).

These tests would pass with Quickcheck 1.X and fail for 2.X which seemed to give up when it fails to generate enough data that satisfies the pre-requisites. The solution is to recast the test so that any list can be used in the test.

The fromBackNodes_coverage test still needs fixing but the solution seems to be to fix the following Arbitrary instance (in src/Util/Data/BackGraph.hs) :

instance Arbitrary (BackGraph Int) where

so that it doesn't create BackGraphs with cycles. Cyclic BackGraphs cause a stack overflow.

Changed 5 years ago by erikd

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in the following two commits:

  • Sat Feb 6 20:58:47 EST 2010 Erik de Castro Lopo <erikd@…>

Fix #109 : Quickcheck tests pass with quickcheck1, fail with quickcheck2.

The second part of the fix for this bug required redoing the Quickcheck Arbitrary instance for BackGraph? to force it to generate sensible sized graphs that are guaranteed to be acyclic.

  • Thu Feb 4 21:13:03 EST 2010 Erik de Castro Lopo <erikd@…>

Fixes for Quickcheck2 (partial fix for #109).

These tests would pass with Quickcheck 1.X and fail for 2.X which seemed to give up when it fails to generate enough data that satisfies the pre-requisites. The solution is to recast the test so that any list can be used in the test.

Note: See TracTickets for help on using tickets.