From 08a60723cc4fec988b5c6e2a8d11fcbcc45cf04a Mon Sep 17 00:00:00 2001 From: Alexey Menshutin Date: Thu, 17 Apr 2025 12:44:59 +0300 Subject: [PATCH] Fix stop strategy for coverage --- .../usvm/samples/recursion/RecursionTest.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/usvm-jvm/src/test/kotlin/org/usvm/samples/recursion/RecursionTest.kt b/usvm-jvm/src/test/kotlin/org/usvm/samples/recursion/RecursionTest.kt index 2aa5de47a7..149aae877f 100644 --- a/usvm-jvm/src/test/kotlin/org/usvm/samples/recursion/RecursionTest.kt +++ b/usvm-jvm/src/test/kotlin/org/usvm/samples/recursion/RecursionTest.kt @@ -95,13 +95,18 @@ internal class RecursionTest : ApproximationsTestRunner() { @Test fun recursionWithExceptionTest() { - checkDiscoveredPropertiesWithExceptions( - Recursion::recursionWithException, - ge(3), - { _, x, r -> x < 42 && r.isException() }, - { _, x, r -> x == 42 && r.isException() }, - { _, x, r -> x > 42 && r.isException() }, - ) + // Two goto statements are expected to not be covered + // The expected coverage is 15 out of 17 instructions + val options = options.copy(stopOnCoverage = 88) + withOptions(options) { + checkDiscoveredPropertiesWithExceptions( + Recursion::recursionWithException, + ge(3), + { _, x, r -> x < 42 && r.isException() }, + { _, x, r -> x == 42 && r.isException() }, + { _, x, r -> x > 42 && r.isException() }, + ) + } } @UsvmTest([Options([PathSelectionStrategy.RANDOM_PATH])])