diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/Domain.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/Domain.kt index 622c3eb534..dd88865448 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/Domain.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/Domain.kt @@ -612,7 +612,7 @@ enum class RuntimeExceptionTestsBehaviour( // Get is mandatory because of the initialization order of the inheritors. // Otherwise, in some cases we could get an incorrect value companion object : CodeGenerationSettingBox { - override val defaultItem: RuntimeExceptionTestsBehaviour get() = FAIL + override val defaultItem: RuntimeExceptionTestsBehaviour get() = PASS override val allItems: List = values().toList() } } diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgAbstractRenderer.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgAbstractRenderer.kt index 1b19e575dd..bb6863e063 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgAbstractRenderer.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgAbstractRenderer.kt @@ -408,19 +408,14 @@ abstract class CgAbstractRenderer( val isBlockTooLarge = workaround(LONG_CODE_FRAGMENTS) { block.size > LARGE_CODE_BLOCK_SIZE } - if (isBlockTooLarge) { - print("/*") - println(" This block of code is ${block.size} lines long and could lead to compilation error") - } - - withIndent { - for (statement in block) { - statement.accept(this) + if (!isBlockTooLarge) { + withIndent { + for (statement in block) { + statement.accept(this) + } } } - if (isBlockTooLarge) println("*/") - print("}") if (printNextLine) println() @@ -982,6 +977,6 @@ abstract class CgAbstractRenderer( /** * @see [LONG_CODE_FRAGMENTS] */ - private const val LARGE_CODE_BLOCK_SIZE: Int = 1000 + private const val LARGE_CODE_BLOCK_SIZE: Int = 150 } } diff --git a/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/utils/StringUtils.kt b/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/utils/StringUtils.kt index 409b7acc85..40f3b5b831 100644 --- a/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/utils/StringUtils.kt +++ b/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/utils/StringUtils.kt @@ -4,5 +4,9 @@ import java.nio.file.FileSystems fun String.toRelativeRawPath(): String { - return "os.path.dirname(__file__) + r'${FileSystems.getDefault().separator}${this}'" + val dirname = "os.path.dirname(__file__)" + if (this.isEmpty()) { + return dirname + } + return "$dirname + r'${FileSystems.getDefault().separator}${this}'" } \ No newline at end of file