@@ -8,7 +8,7 @@ import org.utbot.framework.plugin.api.CodegenLanguage
88import org.utbot.testcheckers.eq
99import org.utbot.testcheckers.withSolverTimeoutInMillis
1010import org.utbot.testcheckers.withTreatingOverflowAsError
11- import org.utbot.testing.AtLeast
11+ import org.utbot.testing.DoNotCalculate
1212import org.utbot.testing.Compilation
1313import org.utbot.testing.UtValueTestCaseChecker
1414import org.utbot.testing.ignoreExecutionsNumber
@@ -32,12 +32,23 @@ internal class OverflowAsErrorTest : UtValueTestCaseChecker(
3232 checkWithException(
3333 OverflowExamples ::intOverflow,
3434 eq(5 ),
35- { x, _, r -> x * x * x <= 0 && x > 0 && r.isException<OverflowDetectionError >() }, // through overflow
36- { x, _, r -> x * x * x <= 0 && x > 0 && r.isException<OverflowDetectionError >() }, // through overflow (2nd '*')
35+ { x, _, r ->
36+ val overflowOccurred = kotlin.runCatching {
37+ Math .multiplyExact(x, x)
38+ }.isFailure
39+ overflowOccurred && r.isException<OverflowDetectionError >()
40+ }, // through overflow
41+ { x, _, r ->
42+ val twoMul = Math .multiplyExact(x, x)
43+ val overflowOccurred = kotlin.runCatching {
44+ Math .multiplyExact(twoMul, x)
45+ }.isFailure
46+ overflowOccurred && r.isException<OverflowDetectionError >()
47+ }, // through overflow (2nd '*')
3748 { x, _, r -> x * x * x >= 0 && x >= 0 && r.getOrNull() == 0 },
3849 { x, y, r -> x * x * x > 0 && x > 0 && y == 10 && r.getOrNull() == 1 },
3950 { x, y, r -> x * x * x > 0 && x > 0 && y != 10 && r.getOrNull() == 0 },
40- coverage = AtLeast ( 90 ),
51+ coverage = DoNotCalculate
4152 )
4253 }
4354 }
@@ -258,7 +269,7 @@ internal class OverflowAsErrorTest : UtValueTestCaseChecker(
258269 }
259270 }
260271
261- // Generated Kotlin code does not compile, so disabled for now
272+ // Generated Kotlin code does not compile, so disabled for now
262273 @Test
263274 @Disabled
264275 fun testQuickSort () {
0 commit comments