Skip to content

Commit 3080413

Browse files
authored
Add processing of usvmExistingButNullString (#2689)
add processing of existingButNullString
1 parent f38dae0 commit 3080413

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import org.usvm.instrumentation.testcase.descriptor.UTestExceptionDescriptor
1111
import org.usvm.instrumentation.testcase.descriptor.UTestObjectDescriptor
1212
import org.usvm.instrumentation.testcase.descriptor.UTestRefDescriptor
1313
import org.usvm.instrumentation.testcase.descriptor.UTestValueDescriptor
14+
import org.usvm.instrumentation.util.InstrumentationModuleConstants.nameForExistingButNullString
1415
import org.utbot.framework.plugin.api.FieldId
1516
import org.utbot.framework.plugin.api.UtArrayModel
1617
import org.utbot.framework.plugin.api.UtClassRefModel
@@ -112,7 +113,7 @@ class JcToUtModelConverter(
112113
is UTestConstantDescriptor.Int -> UtPrimitiveModel(valueDescriptor.value)
113114
is UTestConstantDescriptor.Long -> UtPrimitiveModel(valueDescriptor.value)
114115
is UTestConstantDescriptor.Short -> UtPrimitiveModel(valueDescriptor.value)
115-
is UTestConstantDescriptor.String -> UtPrimitiveModel(valueDescriptor.value)
116+
is UTestConstantDescriptor.String -> constructString(valueDescriptor.value)
116117

117118
is UTestCyclicReferenceDescriptor -> descriptorToModelCache.getValue(
118119
refIdToDescriptorCache.getValue(valueDescriptor.refId)
@@ -156,4 +157,11 @@ class JcToUtModelConverter(
156157
return model
157158
}
158159

160+
private fun constructString(valueDescriptorValue: String): UtModel {
161+
if(valueDescriptorValue == nameForExistingButNullString){
162+
return UtNullModel(stringClassId)
163+
}
164+
return UtPrimitiveModel(valueDescriptorValue)
165+
}
166+
159167
}

0 commit comments

Comments
 (0)