Skip to content

Commit d36b988

Browse files
MarkoutteAbdullinAM
authored andcommitted
Concrete execution fails for a static method using a static field UnitTestBot#711 (UnitTestBot#1143)
1 parent 4706d1b commit d36b988

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ class UtBotSymbolicEngine(
456456
} else {
457457
null
458458
}
459-
460459
else -> {
461460
ObjectModelProvider(defaultIdGenerator).withFallback(fallbackModelProvider).generate(
462461
syntheticMethodForFuzzingThisInstanceDescription
@@ -482,6 +481,10 @@ class UtBotSymbolicEngine(
482481
var attempts = 0
483482
val attemptsLimit = UtSettings.fuzzingMaxAttempts
484483
val hasMethodUnderTestParametersToFuzz = executableId.parameters.isNotEmpty()
484+
if (!hasMethodUnderTestParametersToFuzz && executableId.isStatic) {
485+
// Currently, fuzzer doesn't work with static methods with empty parameters
486+
return@flow
487+
}
485488
val fuzzedValues = if (hasMethodUnderTestParametersToFuzz) {
486489
fuzz(methodUnderTestDescription, modelProvider(defaultModelProviders(defaultIdGenerator)))
487490
} else {

0 commit comments

Comments
 (0)