Skip to content

Commit 4a98ec5

Browse files
authored
Fix stop strategy for coverage (#272)
1 parent 0d9ca9d commit 4a98ec5

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

usvm-jvm/src/test/kotlin/org/usvm/samples/recursion/RecursionTest.kt

+12-7
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,18 @@ internal class RecursionTest : ApproximationsTestRunner() {
9595

9696
@Test
9797
fun recursionWithExceptionTest() {
98-
checkDiscoveredPropertiesWithExceptions(
99-
Recursion::recursionWithException,
100-
ge(3),
101-
{ _, x, r -> x < 42 && r.isException<IllegalArgumentException>() },
102-
{ _, x, r -> x == 42 && r.isException<IllegalArgumentException>() },
103-
{ _, x, r -> x > 42 && r.isException<IllegalArgumentException>() },
104-
)
98+
// Two goto statements are expected to not be covered
99+
// The expected coverage is 15 out of 17 instructions
100+
val options = options.copy(stopOnCoverage = 88)
101+
withOptions(options) {
102+
checkDiscoveredPropertiesWithExceptions(
103+
Recursion::recursionWithException,
104+
ge(3),
105+
{ _, x, r -> x < 42 && r.isException<IllegalArgumentException>() },
106+
{ _, x, r -> x == 42 && r.isException<IllegalArgumentException>() },
107+
{ _, x, r -> x > 42 && r.isException<IllegalArgumentException>() },
108+
)
109+
}
105110
}
106111

107112
@UsvmTest([Options([PathSelectionStrategy.RANDOM_PATH])])

0 commit comments

Comments
 (0)