-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aded spec for the different versions of fakeps, fixes #18
Signed-off-by: Konstantin Läufer <[email protected]>
- Loading branch information
Showing
7 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package edu.luc.etl.osdi.processtree.scala | ||
package fakeps | ||
|
||
import org.scalatest.FunSuite | ||
|
||
/** Tests for the fakeps algorithms. */ | ||
class Spec extends FunSuite { | ||
|
||
val sizes = Seq(10, 100, 1000, 10000) | ||
|
||
type FakePS = Int => Iterator[(Int, Int)] | ||
|
||
def isFlattenedTree(i: Iterator[(Int, Int)]): Boolean = { | ||
val ps = i.toMap | ||
(ps.get(1) == Some(0)) && (ps - 1).values.forall(ps.contains(_)) | ||
} | ||
|
||
def testFakePs(f: FakePS, label: String): Unit = | ||
test(label + " should return a proper flattened ps tree") { | ||
for (s <- sizes) | ||
assert(isFlattenedTree(f(s))) | ||
} | ||
|
||
testFakePs(fakePsMutable, "fakePsMutable") | ||
testFakePs(fakePsFold, "fakePsFold") | ||
testFakePs(fakePsFoldSlow, "fakePsFoldSlow") | ||
testFakePs(fakePsArray, "fakePsArray") | ||
testFakePs(fakePsArrayPar, "fakePsArrayPar") | ||
testFakePs(fakePsArrayTrie, "fakePsArrayTrie") | ||
testFakePs(fakePsArraySTM, "fakePsArraySTM") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package edu.luc.etl.osdi.processtree.scala | ||
package fold | ||
|
||
class Spec extends common.TreeBuilderSpec with FoldTreeBuilder | ||
class Spec extends common.TreeBuilderSpec("fold") with FoldTreeBuilder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package edu.luc.etl.osdi.processtree.scala | ||
package groupby | ||
|
||
class Spec extends common.TreeBuilderSpec with GroupByTreeBuilder | ||
class Spec extends common.TreeBuilderSpec("groupby") with GroupByTreeBuilder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package edu.luc.etl.osdi.processtree.scala | ||
package mutable | ||
|
||
class Spec extends common.TreeBuilderSpec with MutableTreeBuilder | ||
class Spec extends common.TreeBuilderSpec("mutable") with MutableTreeBuilder |