From 49d47cb3723c9d3160e3f215808b571a05d1b252 Mon Sep 17 00:00:00 2001 From: Aleksandar Pokopec Date: Sat, 27 Nov 2010 22:13:27 +0000 Subject: Refactored parallel collections for pluggable t... Refactored parallel collections for pluggable task support implementations. No review. --- .../parallel-collections/ParallelIterableCheck.scala | 14 ++++++++------ test/files/scalacheck/parallel-collections/pc.scala | 14 +++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'test') diff --git a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala index d2d6119997..e8838de3f5 100644 --- a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala +++ b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala @@ -140,7 +140,8 @@ abstract class ParallelIterableCheck[T](collName: String) extends Properties(col val results = for ((f, ind) <- mapFunctions.zipWithIndex) yield { val ms = t.map(f) val mp = coll.map(f) - if (!areEqual(ms, mp) || !checkDataStructureInvariants(ms, mp)) { + val invs = checkDataStructureInvariants(ms, mp) + if (!areEqual(ms, mp) || !invs) { println(t) println(coll) println("mapped to: ") @@ -149,9 +150,9 @@ abstract class ParallelIterableCheck[T](collName: String) extends Properties(col println("sizes: ") println(ms.size) println(mp.size) - println("valid: " + checkDataStructureInvariants(ms, mp)) + println("valid: " + invs) } - ("op index: " + ind) |: (areEqual(ms, mp) && checkDataStructureInvariants(ms, mp)) + ("op index: " + ind) |: (areEqual(ms, mp) && invs) } results.reduceLeft(_ && _) } @@ -181,7 +182,8 @@ abstract class ParallelIterableCheck[T](collName: String) extends Properties(col (for ((p, ind) <- filterPredicates.zipWithIndex) yield { val tf = t.filter(p) val cf = coll.filter(p) - if (tf != cf || cf != tf || !checkDataStructureInvariants(tf, cf)) { + val invs = checkDataStructureInvariants(tf, cf) + if (tf != cf || cf != tf || !invs) { println(t) println(coll) println("filtered to:") @@ -190,9 +192,9 @@ abstract class ParallelIterableCheck[T](collName: String) extends Properties(col println("tf == cf - " + (tf == cf)) println("cf == tf - " + (cf == tf)) printDataStructureDebugInfo(cf) - println("valid: " + checkDataStructureInvariants(tf, cf)) + println("valid: " + invs) } - ("op index: " + ind) |: tf == cf && cf == tf && checkDataStructureInvariants(tf, cf) + ("op index: " + ind) |: tf == cf && cf == tf && invs }).reduceLeft(_ && _) } diff --git a/test/files/scalacheck/parallel-collections/pc.scala b/test/files/scalacheck/parallel-collections/pc.scala index 33d5a28322..efc393889e 100644 --- a/test/files/scalacheck/parallel-collections/pc.scala +++ b/test/files/scalacheck/parallel-collections/pc.scala @@ -11,22 +11,22 @@ class ParCollProperties extends Properties("Parallel collections") { /* Collections */ // parallel arrays - // include(mutable.IntParallelArrayCheck) + //include(mutable.IntParallelArrayCheck) // parallel ranges - // include(immutable.ParallelRangeCheck) + //include(immutable.ParallelRangeCheck) // parallel immutable hash maps (tries) - // include(immutable.IntIntParallelHashMapCheck) + //include(immutable.IntIntParallelHashMapCheck) // parallel immutable hash sets (tries) - // include(immutable.IntParallelHashSetCheck) + //include(immutable.IntParallelHashSetCheck) // parallel mutable hash maps (tables) - // include(mutable.IntIntParallelHashMapCheck) + //include(mutable.IntIntParallelHashMapCheck) // parallel mutable hash sets (tables) - // include(mutable.IntParallelHashSetCheck) + //include(mutable.IntParallelHashSetCheck) // parallel vectors @@ -52,7 +52,7 @@ object Test { workers = 1, minSize = 0, maxSize = 4000, - minSuccessfulTests = 250 + minSuccessfulTests = 150 ), pc ) -- cgit v1.2.3