Skip to content

Commit b3a41e1

Browse files
committed
Cleanup tests
1 parent cfc87cd commit b3a41e1

9 files changed

+26
-11
lines changed

usvm-ts/src/test/kotlin/org/usvm/reachability/AsyncReachabilityTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jacodb.ets.model.EtsIfStmt
44
import org.jacodb.ets.model.EtsReturnStmt
55
import org.jacodb.ets.model.EtsScene
66
import org.jacodb.ets.utils.loadEtsFileAutoConvert
7+
import org.junit.jupiter.api.Disabled
78
import org.usvm.PathSelectionStrategy
89
import org.usvm.SolverType
910
import org.usvm.UMachineOptions
@@ -113,6 +114,7 @@ class AsyncReachabilityTest {
113114
)
114115
}
115116

117+
@Disabled("No ::map method")
116118
@Test
117119
fun testPromiseAllReachable() {
118120
// Test reachability through Promise.all pattern:
@@ -150,6 +152,7 @@ class AsyncReachabilityTest {
150152
)
151153
}
152154

155+
@Disabled("Function types are not supported in EtsHierarchy")
153156
@Test
154157
fun testCallbackReachable() {
155158
// Test reachability through callback pattern:

usvm-ts/src/test/kotlin/org/usvm/reachability/BasicConditionsReachabilityTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class BasicConditionsReachabilityTest {
101101
target = target.addChild(TsReachabilityTarget.IntermediatePoint(secondIf))
102102

103103
// return -1
104-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
104+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
105105
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
106106

107107
val results = machine.analyze(listOf(method), listOf(initialTarget))
@@ -216,7 +216,7 @@ class BasicConditionsReachabilityTest {
216216
target = target.addChild(TsReachabilityTarget.IntermediatePoint(secondIf))
217217

218218
// return -1
219-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
219+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
220220
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
221221

222222
val results = machine.analyze(listOf(method), listOf(initialTarget))

usvm-ts/src/test/kotlin/org/usvm/reachability/ComplexReachabilityTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jacodb.ets.model.EtsIfStmt
44
import org.jacodb.ets.model.EtsReturnStmt
55
import org.jacodb.ets.model.EtsScene
66
import org.jacodb.ets.utils.loadEtsFileAutoConvert
7+
import org.junit.jupiter.api.Disabled
78
import org.usvm.PathSelectionStrategy
89
import org.usvm.SolverType
910
import org.usvm.UMachineOptions
@@ -95,7 +96,7 @@ class ComplexReachabilityTest {
9596
target = target.addChild(TsReachabilityTarget.IntermediatePoint(firstIf))
9697

9798
// return 1
98-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
99+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
99100
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
100101

101102
val results = machine.analyze(listOf(method), listOf(initialTarget))
@@ -147,6 +148,7 @@ class ComplexReachabilityTest {
147148
)
148149
}
149150

151+
@Disabled("Multiple methods ::process")
150152
@Test
151153
fun testConditionalObjectReachable() {
152154
// Test reachability with conditional object creation and polymorphic method calls
@@ -167,7 +169,7 @@ class ComplexReachabilityTest {
167169
target = target.addChild(TsReachabilityTarget.IntermediatePoint(secondIf))
168170

169171
// return 1
170-
val return1 = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
172+
val return1 = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[2]
171173
target.addChild(TsReachabilityTarget.FinalPoint(return1))
172174

173175
// return 2

usvm-ts/src/test/kotlin/org/usvm/reachability/FunctionCallReachabilityTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class FunctionCallReachabilityTest {
161161
target = target.addChild(TsReachabilityTarget.IntermediatePoint(check))
162162

163163
// return 1
164-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
164+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
165165
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
166166

167167
val results = machine.analyze(listOf(method), listOf(initialTarget))

usvm-ts/src/test/kotlin/org/usvm/reachability/HigherOrderFunctionsReachabilityTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jacodb.ets.model.EtsIfStmt
44
import org.jacodb.ets.model.EtsReturnStmt
55
import org.jacodb.ets.model.EtsScene
66
import org.jacodb.ets.utils.loadEtsFileAutoConvert
7+
import org.junit.jupiter.api.Disabled
78
import org.usvm.PathSelectionStrategy
89
import org.usvm.SolverType
910
import org.usvm.UMachineOptions
@@ -21,6 +22,7 @@ import kotlin.time.Duration
2122
* Tests for higher-order functions and closures reachability scenarios.
2223
* Verifies reachability analysis through function composition and array processing patterns.
2324
*/
25+
@Disabled("Iterators are not supported")
2426
class HigherOrderFunctionsReachabilityTest {
2527

2628
private val scene = run {

usvm-ts/src/test/kotlin/org/usvm/reachability/InheritanceReachabilityTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jacodb.ets.model.EtsIfStmt
44
import org.jacodb.ets.model.EtsReturnStmt
55
import org.jacodb.ets.model.EtsScene
66
import org.jacodb.ets.utils.loadEtsFileAutoConvert
7+
import org.junit.jupiter.api.Disabled
78
import org.usvm.PathSelectionStrategy
89
import org.usvm.SolverType
910
import org.usvm.UMachineOptions
@@ -21,6 +22,7 @@ import kotlin.time.Duration
2122
* Tests for class inheritance and polymorphism reachability scenarios.
2223
* Verifies reachability analysis through class hierarchies, method overriding, and inheritance patterns.
2324
*/
25+
@Disabled("Inheritance is hard")
2426
class InheritanceReachabilityTest {
2527

2628
private val scene = run {

usvm-ts/src/test/kotlin/org/usvm/reachability/LoopsReachabilityTest.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jacodb.ets.model.EtsIfStmt
44
import org.jacodb.ets.model.EtsReturnStmt
55
import org.jacodb.ets.model.EtsScene
66
import org.jacodb.ets.utils.loadEtsFileAutoConvert
7+
import org.junit.jupiter.api.Disabled
78
import org.usvm.PathSelectionStrategy
89
import org.usvm.SolverType
910
import org.usvm.UMachineOptions
@@ -148,6 +149,7 @@ class LoopsReachabilityTest {
148149
)
149150
}
150151

152+
@Disabled("Iterators are not yet supported")
151153
@Test
152154
fun testForInLoopReachable() {
153155
// Test reachability through for-in loop:
@@ -169,7 +171,7 @@ class LoopsReachabilityTest {
169171
target = target.addChild(TsReachabilityTarget.IntermediatePoint(valueCheck))
170172

171173
// return 1
172-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
174+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
173175
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
174176

175177
val results = machine.analyze(listOf(method), listOf(initialTarget))
@@ -185,6 +187,7 @@ class LoopsReachabilityTest {
185187
)
186188
}
187189

190+
@Disabled("Iterators are not yet supported")
188191
@Test
189192
fun testForOfLoopReachable() {
190193
// Test reachability through for-of loop:
@@ -206,7 +209,7 @@ class LoopsReachabilityTest {
206209
target = target.addChild(TsReachabilityTarget.IntermediatePoint(maxCheck))
207210

208211
// return 1
209-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
212+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
210213
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
211214

212215
val results = machine.analyze(listOf(method), listOf(initialTarget))
@@ -239,7 +242,7 @@ class LoopsReachabilityTest {
239242
target = target.addChild(TsReachabilityTarget.IntermediatePoint(thresholdCheck))
240243

241244
// return 1
242-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
245+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
243246
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
244247

245248
val results = machine.analyze(listOf(method), listOf(initialTarget))

usvm-ts/src/test/kotlin/org/usvm/reachability/RecursionReachabilityTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import kotlin.time.Duration
2222
* Tests for recursion reachability scenarios.
2323
* Verifies reachability analysis through recursive function calls with controlled depth limits.
2424
*/
25+
@Disabled("Recursion is not fully supported yet")
2526
class RecursionReachabilityTest {
2627

2728
private val scene = run {

usvm-ts/src/test/kotlin/org/usvm/reachability/TypeGuardsReachabilityTest.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jacodb.ets.model.EtsIfStmt
44
import org.jacodb.ets.model.EtsReturnStmt
55
import org.jacodb.ets.model.EtsScene
66
import org.jacodb.ets.utils.loadEtsFileAutoConvert
7+
import org.junit.jupiter.api.Disabled
78
import org.usvm.PathSelectionStrategy
89
import org.usvm.SolverType
910
import org.usvm.UMachineOptions
@@ -80,6 +81,7 @@ class TypeGuardsReachabilityTest {
8081
)
8182
}
8283

84+
@Disabled("Fake type in type constraints")
8385
@Test
8486
fun testInstanceofGuardReachable() {
8587
// Test reachability through instanceof type guard:
@@ -101,7 +103,7 @@ class TypeGuardsReachabilityTest {
101103
target = target.addChild(TsReachabilityTarget.IntermediatePoint(lengthCheck))
102104

103105
// return 1
104-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
106+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
105107
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
106108

107109
val results = machine.analyze(listOf(method), listOf(initialTarget))
@@ -171,7 +173,7 @@ class TypeGuardsReachabilityTest {
171173
target = target.addChild(TsReachabilityTarget.IntermediatePoint(assertionCheck))
172174

173175
// return 1
174-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
176+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
175177
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
176178

177179
val results = machine.analyze(listOf(method), listOf(initialTarget))
@@ -286,7 +288,7 @@ class TypeGuardsReachabilityTest {
286288
target = target.addChild(TsReachabilityTarget.IntermediatePoint(boolCheck))
287289

288290
// return 1
289-
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[0]
291+
val returnStmt = method.cfg.stmts.filterIsInstance<EtsReturnStmt>()[1]
290292
target.addChild(TsReachabilityTarget.FinalPoint(returnStmt))
291293

292294
val results = machine.analyze(listOf(method), listOf(initialTarget))

0 commit comments

Comments
 (0)