Skip to content

Commit 4fa518e

Browse files
authored
Hack for Random mocks (#2702)
1 parent 1f24d07 commit 4fa518e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/jc/JcTestExecutor.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,12 @@ class JcTestExecutor(
149149
override fun allocateString(value: UTestExpression): UTestExpression = value
150150

151151
override fun resolveObject(ref: UConcreteHeapRef, heapRef: UHeapRef, type: JcClassType): UTestExpression {
152-
if (ref !in resolvedMethodMocks) {
152+
if (ref !in resolvedMethodMocks || type.jcClass.name != "java.util.Random") {
153153
return super.resolveObject(ref, heapRef, type)
154154
}
155155

156+
// Hack: mock only Random
157+
156158
val mocks = resolvedMethodMocks.getValue(ref)
157159

158160
val fieldValues = mutableMapOf<JcField, UTestExpression>()

0 commit comments

Comments
 (0)