Skip to content

Add processing of usvmExistingButNullString #2689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.usvm.instrumentation.testcase.descriptor.UTestExceptionDescriptor
import org.usvm.instrumentation.testcase.descriptor.UTestObjectDescriptor
import org.usvm.instrumentation.testcase.descriptor.UTestRefDescriptor
import org.usvm.instrumentation.testcase.descriptor.UTestValueDescriptor
import org.usvm.instrumentation.util.InstrumentationModuleConstants.nameForExistingButNullString
import org.utbot.framework.plugin.api.FieldId
import org.utbot.framework.plugin.api.UtArrayModel
import org.utbot.framework.plugin.api.UtClassRefModel
Expand Down Expand Up @@ -112,7 +113,7 @@ class JcToUtModelConverter(
is UTestConstantDescriptor.Int -> UtPrimitiveModel(valueDescriptor.value)
is UTestConstantDescriptor.Long -> UtPrimitiveModel(valueDescriptor.value)
is UTestConstantDescriptor.Short -> UtPrimitiveModel(valueDescriptor.value)
is UTestConstantDescriptor.String -> UtPrimitiveModel(valueDescriptor.value)
is UTestConstantDescriptor.String -> constructString(valueDescriptor.value)

is UTestCyclicReferenceDescriptor -> descriptorToModelCache.getValue(
refIdToDescriptorCache.getValue(valueDescriptor.refId)
Expand Down Expand Up @@ -156,4 +157,11 @@ class JcToUtModelConverter(
return model
}

private fun constructString(valueDescriptorValue: String): UtModel {
if(valueDescriptorValue == nameForExistingButNullString){
return UtNullModel(stringClassId)
}
return UtPrimitiveModel(valueDescriptorValue)
}

}