From 950ca328548689f4d4da82e3c8456d9e98ea08d4 Mon Sep 17 00:00:00 2001 From: Maksim Pelevin Date: Wed, 12 Oct 2022 13:09:22 +0300 Subject: [PATCH] Concrete execution fails for a static method using a static field #711 --- .../src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt index 03f56a598f..3f75c7db26 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt @@ -436,6 +436,10 @@ class UtBotSymbolicEngine( var attempts = 0 val attemptsLimit = UtSettings.fuzzingMaxAttempts val hasMethodUnderTestParametersToFuzz = methodUnderTest.parameters.isNotEmpty() + if (!hasMethodUnderTestParametersToFuzz && methodUnderTest.isStatic) { + // Currently, fuzzer doesn't work with static methods with empty parameters + return@flow + } val fuzzedValues = if (hasMethodUnderTestParametersToFuzz) { fuzz(methodUnderTestDescription, modelProvider(defaultModelProviders(defaultIdGenerator))) } else {