diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-12-09 10:08:24 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-12-09 10:08:24 +0000 |
commit | 11dfc5a64dd8bbcb7fca7d608a23b513316de6cc (patch) | |
tree | c951c2e3730ad2a88de39e9d5ca40303e22d2c91 /test/files | |
parent | f2ecbd04691b1914e2f77c60afc2b296aa6826ae (diff) | |
download | scala-11dfc5a64dd8bbcb7fca7d608a23b513316de6cc.tar.gz scala-11dfc5a64dd8bbcb7fca7d608a23b513316de6cc.tar.bz2 scala-11dfc5a64dd8bbcb7fca7d608a23b513316de6cc.zip |
Made parallel collections serializable.
No review.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/jvm/serialization.check | 35 | ||||
-rw-r--r-- | test/files/jvm/serialization.scala | 57 | ||||
-rw-r--r-- | test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala | 2 | ||||
-rw-r--r-- | test/files/scalacheck/parallel-collections/pc.scala | 2 |
4 files changed, 93 insertions, 3 deletions
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check index 7b2b8cc18f..0717de2a8e 100644 --- a/test/files/jvm/serialization.check +++ b/test/files/jvm/serialization.check @@ -270,4 +270,37 @@ x equals y: true, y equals x: true 1 2 1 -2
\ No newline at end of file +2 + +x = UnrolledBuffer(one, two) +y = UnrolledBuffer(one, two) +x equals y: true, y equals x: true + +x = ParArray(abc, def, etc) +y = ParArray(abc, def, etc) +x equals y: true, y equals x: true + +x = ParHashMap(1 -> 2, 2 -> 4) +y = ParHashMap(1 -> 2, 2 -> 4) +x equals y: true, y equals x: true + +x = ParHashSet(2, 1, 3) +y = ParHashSet(2, 1, 3) +x equals y: true, y equals x: true + +x = ParRange(0, 1, 2, 3, 4) +y = ParRange(0, 1, 2, 3, 4) +x equals y: true, y equals x: true + +x = ParRange(0, 1, 2, 3) +y = ParRange(0, 1, 2, 3) +x equals y: true, y equals x: true + +x = ParMap(5 -> 1, 10 -> 2) +y = ParMap(5 -> 1, 10 -> 2) +x equals y: true, y equals x: true + +x = ParSet(two, one) +y = ParSet(two, one) +x equals y: true, y equals x: true + diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala index 2e34079505..8c4df8fc37 100644 --- a/test/files/jvm/serialization.scala +++ b/test/files/jvm/serialization.scala @@ -397,6 +397,7 @@ object Test3_mutable { } } + //############################################################################ // Test classes in package "scala.xml" @@ -587,8 +588,64 @@ object Test { Test6 Test7 Test8 + Test9_parallel } } //############################################################################ + +//############################################################################ +// Test classes in package "scala.collection.parallel" and subpackages +object Test9_parallel { + import scala.collection.parallel._ + + try { + println() + + // UnrolledBuffer + val ub = new UnrolledBuffer[String] + ub ++= List("one", "two") + val _ub: UnrolledBuffer[String] = read(write(ub)) + check(ub, _ub) + + // mutable.ParArray + val pa = mutable.ParArray("abc", "def", "etc") + val _pa: mutable.ParArray[String] = read(write(pa)) + check(pa, _pa) + + // mutable.ParHashMap + val mpm = mutable.ParHashMap(1 -> 2, 2 -> 4) + val _mpm: mutable.ParHashMap[Int, Int] = read(write(mpm)) + check(mpm, _mpm) + + // mutable.ParHashSet + val mps = mutable.ParHashSet(1, 2, 3) + val _mps: mutable.ParHashSet[Int] = read(write(mps)) + check(mps, _mps) + + // immutable.ParRange + val pr1 = immutable.ParRange(0, 4, 1, true) + val _pr1: immutable.ParRange = read(write(pr1)) + check(pr1, _pr1) + + val pr2 = immutable.ParRange(0, 4, 1, false) + val _pr2: immutable.ParRange = read(write(pr2)) + check(pr2, _pr2) + + // immutable.ParHashMap + val ipm = immutable.ParHashMap(5 -> 1, 10 -> 2) + val _ipm: immutable.ParHashMap[Int, Int] = read(write(ipm)) + check(ipm, _ipm) + + // immutable.ParHashSet + val ips = immutable.ParHashSet("one", "two") + val _ips: immutable.ParHashSet[String] = read(write(ips)) + check(ips, _ips) + + } catch { + case e: Exception => + println("Error in Test5_parallel: " + e) + throw e + } +} diff --git a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala index 0dcd877ecb..60e8c8b1f2 100644 --- a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala +++ b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala @@ -86,7 +86,7 @@ abstract class ParallelIterableCheck[T](collName: String) extends Properties(col println("Collection debug info: ") coll.printDebugBuffer println("Task debug info: ") - println(coll.tasksupport.debugMessages.mkString("\n")) + println(tasksupport.debugMessages.mkString("\n")) } def printComparison(t: Traversable[_], coll: ParIterable[_], tf: Traversable[_], cf: ParIterable[_], ind: Int) { diff --git a/test/files/scalacheck/parallel-collections/pc.scala b/test/files/scalacheck/parallel-collections/pc.scala index 590da6dba4..8d88d36610 100644 --- a/test/files/scalacheck/parallel-collections/pc.scala +++ b/test/files/scalacheck/parallel-collections/pc.scala @@ -52,7 +52,7 @@ object Test { workers = 1, minSize = 0, maxSize = 4000, - minSuccessfulTests = 120 + minSuccessfulTests = 20 ), pc ) |