Skip to content

Commit

Permalink
Added seed to dpor test
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Jul 25, 2023
1 parent e9b055f commit e81dc57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ import org.junit.jupiter.api.Assertions
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import java.util.*
import kotlin.random.Random


class XcfaExplAnalysisTest {


companion object {
private val seed = 1001

@JvmStatic
fun data(): Collection<Array<Any>> {
Expand Down Expand Up @@ -145,6 +147,7 @@ class XcfaExplAnalysisTest {
@ParameterizedTest
@MethodSource("data")
fun testDporExpl(filepath: String, verdict: (SafetyResult<*, *>) -> Boolean) {
XcfaDporLts.random = Random(seed)
println("Testing DPOR on $filepath...")
val stream = javaClass.getResourceAsStream(filepath)
val xcfa = getXcfaFromC(stream!!, ParseContext(), false, false).first
Expand Down Expand Up @@ -231,6 +234,7 @@ class XcfaExplAnalysisTest {
@ParameterizedTest
@MethodSource("data")
fun testAadporExpl(filepath: String, verdict: (SafetyResult<*, *>) -> Boolean) {
XcfaDporLts.random = Random(seed)
println("Testing AADPOR on $filepath...")
val stream = javaClass.getResourceAsStream(filepath)
val xcfa = getXcfaFromC(stream!!, ParseContext(), false, false).first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ import org.junit.jupiter.api.Assertions
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import java.util.*
import kotlin.random.Random


class XcfaPredAnalysisTest {


companion object {

private val seed = 1001;

@JvmStatic
fun data(): Collection<Array<Any>> {
return listOf(
Expand Down Expand Up @@ -149,6 +152,7 @@ class XcfaPredAnalysisTest {
@ParameterizedTest
@MethodSource("data")
fun testDporPred(filepath: String, verdict: (SafetyResult<*, *>) -> Boolean) {
XcfaDporLts.random = Random(seed)
println("Testing DPOR on $filepath...")
val stream = javaClass.getResourceAsStream(filepath)
val xcfa = getXcfaFromC(stream!!, ParseContext(), false, false).first
Expand Down Expand Up @@ -238,6 +242,7 @@ class XcfaPredAnalysisTest {
@ParameterizedTest
@MethodSource("data")
fun testAadporPred(filepath: String, verdict: (SafetyResult<*, *>) -> Boolean) {
XcfaDporLts.random = Random(seed)
println("Testing AADPOR on $filepath...")
val stream = javaClass.getResourceAsStream(filepath)
val xcfa = getXcfaFromC(stream!!, ParseContext(), false, false).first
Expand Down

0 comments on commit e81dc57

Please sign in to comment.