From f5215cd20ca5bc4566538c87e7095ec65b63aaae Mon Sep 17 00:00:00 2001 From: Aleksandar Prokopec Date: Fri, 16 Mar 2012 16:11:41 +0100 Subject: Renaming Ctrie to ConcurrentTrieMap. --- test/files/scalacheck/Ctrie.scala | 14 +++++++------- .../parallel-collections/ParallelCtrieCheck.scala | 12 ++++++------ test/files/scalacheck/parallel-collections/pc.scala | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'test/files/scalacheck') diff --git a/test/files/scalacheck/Ctrie.scala b/test/files/scalacheck/Ctrie.scala index 2950937278..b9d71b88a3 100644 --- a/test/files/scalacheck/Ctrie.scala +++ b/test/files/scalacheck/Ctrie.scala @@ -5,7 +5,7 @@ import org.scalacheck._ import Prop._ import org.scalacheck.Gen._ import collection._ -import collection.mutable.Ctrie +import collection.mutable.ConcurrentTrieMap @@ -16,7 +16,7 @@ case class Wrap(i: Int) { /** A check mainly oriented towards checking snapshot correctness. */ -object Test extends Properties("Ctrie") { +object Test extends Properties("ConcurrentTrieMap") { /* generators */ @@ -102,7 +102,7 @@ object Test extends Properties("Ctrie") { (numThreads, numElems) => val p = 3 //numThreads val sz = 102 //numElems - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] // checker val checker = spawn { @@ -134,7 +134,7 @@ object Test extends Properties("Ctrie") { property("update") = forAll(sizes) { (n: Int) => - val ct = new Ctrie[Int, Int] + val ct = new ConcurrentTrieMap[Int, Int] for (i <- 0 until n) ct(i) = i (0 until n) forall { case i => ct(i) == i @@ -143,7 +143,7 @@ object Test extends Properties("Ctrie") { property("concurrent update") = forAll(threadCountsAndSizes) { case (p, sz) => - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] inParallel(p) { idx => @@ -158,7 +158,7 @@ object Test extends Properties("Ctrie") { property("concurrent remove") = forAll(threadCounts, sizes) { (p, sz) => - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct(Wrap(i)) = i inParallel(p) { @@ -174,7 +174,7 @@ object Test extends Properties("Ctrie") { property("concurrent putIfAbsent") = forAll(threadCounts, sizes) { (p, sz) => - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] val results = inParallel(p) { idx => diff --git a/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala b/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala index d1924f0ada..a04c0ff8d4 100644 --- a/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala +++ b/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala @@ -15,25 +15,25 @@ import scala.collection.parallel.ops._ -abstract class ParallelCtrieCheck[K, V](tp: String) extends ParallelMapCheck[K, V]("mutable.ParCtrie[" + tp + "]") { +abstract class ParallelConcurrentTrieMapCheck[K, V](tp: String) extends ParallelMapCheck[K, V]("mutable.ParConcurrentTrieMap[" + tp + "]") { // ForkJoinTasks.defaultForkJoinPool.setMaximumPoolSize(Runtime.getRuntime.availableProcessors * 2) // ForkJoinTasks.defaultForkJoinPool.setParallelism(Runtime.getRuntime.availableProcessors * 2) - type CollType = ParCtrie[K, V] + type CollType = ParConcurrentTrieMap[K, V] def isCheckingViews = false def hasStrictOrder = false def ofSize(vals: Seq[Gen[(K, V)]], sz: Int) = { - val ct = new mutable.Ctrie[K, V] + val ct = new mutable.ConcurrentTrieMap[K, V] val gen = vals(rnd.nextInt(vals.size)) for (i <- 0 until sz) ct += sample(gen) ct } def fromTraversable(t: Traversable[(K, V)]) = { - val pct = new ParCtrie[K, V] + val pct = new ParConcurrentTrieMap[K, V] var i = 0 for (kv <- t.toList) { pct += kv @@ -45,7 +45,7 @@ abstract class ParallelCtrieCheck[K, V](tp: String) extends ParallelMapCheck[K, } -object IntIntParallelCtrieCheck extends ParallelCtrieCheck[Int, Int]("Int, Int") +object IntIntParallelConcurrentTrieMapCheck extends ParallelConcurrentTrieMapCheck[Int, Int]("Int, Int") with PairOperators[Int, Int] with PairValues[Int, Int] { @@ -58,7 +58,7 @@ with PairValues[Int, Int] def koperators = intoperators override def printDataStructureDebugInfo(ds: AnyRef) = ds match { - case pm: ParCtrie[k, v] => + case pm: ParConcurrentTrieMap[k, v] => println("Mutable parallel ctrie") case _ => println("could not match data structure type: " + ds.getClass) diff --git a/test/files/scalacheck/parallel-collections/pc.scala b/test/files/scalacheck/parallel-collections/pc.scala index 8a0dba3c25..0a91977da0 100644 --- a/test/files/scalacheck/parallel-collections/pc.scala +++ b/test/files/scalacheck/parallel-collections/pc.scala @@ -26,7 +26,7 @@ class ParCollProperties extends Properties("Parallel collections") { include(mutable.IntIntParallelHashMapCheck) // parallel ctrie - include(mutable.IntIntParallelCtrieCheck) + include(mutable.IntIntParallelConcurrentTrieMapCheck) // parallel mutable hash sets (tables) include(mutable.IntParallelHashSetCheck) -- cgit v1.2.3