Skip to content

Commit 4a0fb03

Browse files
committed
Code improvements
1 parent 7b9bca0 commit 4a0fb03

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgMethodConstructor.kt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ package org.utbot.framework.codegen.model.constructor.tree
33
import org.utbot.common.PathUtil
44
import org.utbot.common.packageName
55
import org.utbot.engine.isStatic
6-
import org.utbot.framework.codegen.*
6+
import org.utbot.framework.codegen.ForceStaticMocking
7+
import org.utbot.framework.codegen.JUNIT5_PARAMETERIZED_PACKAGE
8+
import org.utbot.framework.codegen.Junit4
9+
import org.utbot.framework.codegen.Junit5
10+
import org.utbot.framework.codegen.ParametrizedTestSource
711
import org.utbot.framework.codegen.RuntimeExceptionTestsBehaviour.PASS
12+
import org.utbot.framework.codegen.TestNg
813
import org.utbot.framework.codegen.model.constructor.builtin.closeMethodIdOrNull
914
import org.utbot.framework.codegen.model.constructor.builtin.forName
1015
import org.utbot.framework.codegen.model.constructor.builtin.getClass
@@ -1043,12 +1048,13 @@ internal class CgMethodConstructor(val context: CgContext) : CgContextOwner by c
10431048
ParametrizedTestSource.DO_NOT_PARAMETRIZE ->
10441049
currentBlock = currentBlock.addAll(generateDeepEqualsAssertion(expected, actual))
10451050
ParametrizedTestSource.PARAMETRIZE -> {
1046-
val trueStmts = listOf<CgStatement>(
1047-
testFrameworkManager.assertions[testFramework.assertNull](actual).toStatement()
1048-
)
1049-
val falseStmts = generateDeepEqualsAssertion(expected, actual)
1051+
val assertNullStmt = listOf(testFrameworkManager.assertions[testFramework.assertNull](actual).toStatement())
10501052
currentBlock = currentBlock.add(
1051-
CgIfStatement(CgEqualTo(expected, nullLiteral()), trueStmts, falseStmts)
1053+
CgIfStatement(
1054+
CgEqualTo(expected, nullLiteral()),
1055+
assertNullStmt,
1056+
generateDeepEqualsAssertion(expected, actual)
1057+
)
10521058
)
10531059
}
10541060
}

0 commit comments

Comments
 (0)