From 47572a7ba9ea3e026850c353ac42bf70d7a56a0e Mon Sep 17 00:00:00 2001 From: Sergei Kharitontcev-Beglov Date: Tue, 20 Aug 2024 18:54:39 +0200 Subject: [PATCH] Changed tests Changed tests to minify the execution time of the tests --- .../org/vorpal/research/kex/concolic/DisableNullsTest.kt | 4 ++-- .../vorpal/research/kex/test/nullability/BoxedArrayNulls.java | 3 +++ .../org/vorpal/research/kex/test/nullability/ListNulls.java | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kex-runner/src/test/kotlin/org/vorpal/research/kex/concolic/DisableNullsTest.kt b/kex-runner/src/test/kotlin/org/vorpal/research/kex/concolic/DisableNullsTest.kt index f8d4a4c79..526885c46 100644 --- a/kex-runner/src/test/kotlin/org/vorpal/research/kex/concolic/DisableNullsTest.kt +++ b/kex-runner/src/test/kotlin/org/vorpal/research/kex/concolic/DisableNullsTest.kt @@ -25,10 +25,10 @@ class DisableNullsTest : ConcolicTest("do-not-generate-nulls") { } @Test fun boxedArrayWithoutNullsTest() { - assertCoverage(cm["org/vorpal/research/kex/test/nullability/BoxedArrayNulls"], 20.0 / 24.0, eps = 0.1) + assertCoverage(cm["org/vorpal/research/kex/test/nullability/BoxedArrayNulls"], 26.0 / 30.0, eps = 0.1) } @Test fun listWithoutNullsTest() { - assertCoverage(cm["org/vorpal/research/kex/test/nullability/ListNulls"], 20.0 / 24.0, eps = 0.1) + assertCoverage(cm["org/vorpal/research/kex/test/nullability/ListNulls"], 26.0 / 30.0, eps = 0.1) } } diff --git a/kex-test/src/main/kotlin/org/vorpal/research/kex/test/nullability/BoxedArrayNulls.java b/kex-test/src/main/kotlin/org/vorpal/research/kex/test/nullability/BoxedArrayNulls.java index 484ddff58..ae24283c8 100644 --- a/kex-test/src/main/kotlin/org/vorpal/research/kex/test/nullability/BoxedArrayNulls.java +++ b/kex-test/src/main/kotlin/org/vorpal/research/kex/test/nullability/BoxedArrayNulls.java @@ -5,6 +5,9 @@ int function(Integer[] x) { if (x == null) { return -1; } + if (x.length > 10) { + return 11; + } for (int i = 0; i < x.length; i++) { if (x[i] == null) { return i; diff --git a/kex-test/src/main/kotlin/org/vorpal/research/kex/test/nullability/ListNulls.java b/kex-test/src/main/kotlin/org/vorpal/research/kex/test/nullability/ListNulls.java index 70a8ec668..0abf1fcda 100644 --- a/kex-test/src/main/kotlin/org/vorpal/research/kex/test/nullability/ListNulls.java +++ b/kex-test/src/main/kotlin/org/vorpal/research/kex/test/nullability/ListNulls.java @@ -7,6 +7,9 @@ int function(List x) { if (x == null) { return -1; } + if (x.size() > 10) { + return 11; + } for (int i = 0; i < x.size(); i++) { if (x.get(i) == null) { return i;