Skip to content

Commit d82460c

Browse files
committed
Fix taint tests
1 parent 9d89a8e commit d82460c

4 files changed

Lines changed: 19 additions & 10 deletions

File tree

utbot-sample/src/main/java/org/utbot/examples/taint/TaintSimple.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.utbot.examples.taint;
22

33
/**
4-
* Config: ./utbot-sample/src/main/resources/taint/SimpleTaintExampleConfig.yaml
4+
* Config: ./utbot-sample/src/main/resources/taint/TaintSimpleConfig.yaml
55
*/
66
public class TaintSimple {
77

utbot-sample/src/main/resources/taint/LongTaintPathConfig.yaml renamed to utbot-sample/src/main/resources/taint/TaintLongPathConfig.yaml

File renamed without changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sources:
2+
- org.utbot.examples.taint.TaintSimple.source:
3+
add-to: return
4+
marks: bad
5+
6+
sinks:
7+
- org.utbot.examples.taint.TaintSimple.sink:
8+
check: arg1
9+
marks: bad

utbot-testing/src/main/kotlin/org/utbot/testing/UtValueTestCaseChecker.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,18 +2077,19 @@ abstract class UtValueTestCaseChecker(
20772077
): UtMethodTestSet {
20782078
val buildInfo = CodeGenerationIntegrationTest.Companion.BuildInfo(buildDir, additionalDependenciesClassPath)
20792079

2080-
val testCaseGenerator = testCaseGeneratorCache
2081-
.getOrPut(buildInfo) { createTestCaseGenerator(buildInfo) }
2080+
val testCaseGenerator = createTestCaseGenerator(buildInfo)
20822081
return testCaseGenerator.generate(method, mockStrategy, additionalMockAlwaysClasses)
20832082
}
20842083

20852084
// factory method
20862085
open fun createTestCaseGenerator(buildInfo: CodeGenerationIntegrationTest.Companion.BuildInfo) =
2087-
TestSpecificTestCaseGenerator(
2088-
buildInfo.buildDir,
2089-
buildInfo.dependencyPath,
2090-
System.getProperty("java.class.path")
2091-
)
2086+
testCaseGeneratorCache.getOrPut(buildInfo) {
2087+
TestSpecificTestCaseGenerator(
2088+
buildInfo.buildDir,
2089+
buildInfo.dependencyPath,
2090+
System.getProperty("java.class.path")
2091+
)
2092+
}
20922093

20932094
fun executionsModel(
20942095
method: ExecutableId,
@@ -2100,8 +2101,7 @@ abstract class UtValueTestCaseChecker(
21002101
computeAdditionalDependenciesClasspathAndBuildDir(method.classId.jClass, additionalDependencies)
21012102
withUtContext(UtContext(method.classId.jClass.classLoader)) {
21022103
val buildInfo = CodeGenerationIntegrationTest.Companion.BuildInfo(buildDir, additionalDependenciesClassPath)
2103-
val testCaseGenerator = testCaseGeneratorCache
2104-
.getOrPut(buildInfo) { createTestCaseGenerator(buildInfo) }
2104+
val testCaseGenerator = createTestCaseGenerator(buildInfo)
21052105
return testCaseGenerator.generate(method, mockStrategy, additionalMockAlwaysClasses)
21062106
}
21072107
}

0 commit comments

Comments
 (0)