@@ -8,7 +8,7 @@ import org.utbot.framework.plugin.api.CodegenLanguage
8
8
import org.utbot.testcheckers.eq
9
9
import org.utbot.testcheckers.withSolverTimeoutInMillis
10
10
import org.utbot.testcheckers.withTreatingOverflowAsError
11
- import org.utbot.testing.AtLeast
11
+ import org.utbot.testing.DoNotCalculate
12
12
import org.utbot.testing.Compilation
13
13
import org.utbot.testing.UtValueTestCaseChecker
14
14
import org.utbot.testing.ignoreExecutionsNumber
@@ -32,12 +32,23 @@ internal class OverflowAsErrorTest : UtValueTestCaseChecker(
32
32
checkWithException(
33
33
OverflowExamples ::intOverflow,
34
34
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 '*')
37
48
{ x, _, r -> x * x * x >= 0 && x >= 0 && r.getOrNull() == 0 },
38
49
{ x, y, r -> x * x * x > 0 && x > 0 && y == 10 && r.getOrNull() == 1 },
39
50
{ x, y, r -> x * x * x > 0 && x > 0 && y != 10 && r.getOrNull() == 0 },
40
- coverage = AtLeast ( 90 ),
51
+ coverage = DoNotCalculate
41
52
)
42
53
}
43
54
}
@@ -258,7 +269,7 @@ internal class OverflowAsErrorTest : UtValueTestCaseChecker(
258
269
}
259
270
}
260
271
261
- // Generated Kotlin code does not compile, so disabled for now
272
+ // Generated Kotlin code does not compile, so disabled for now
262
273
@Test
263
274
@Disabled
264
275
fun testQuickSort () {
0 commit comments