-
Couldn't load subscription status.
- Fork 45
Initial implementations of the adapter from JcExecution to UtExecution #2677
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
Changes from 29 commits
6d4f05c
4aa8a10
ddcf870
9532b8a
d79ea8b
8e30b30
5935d7b
535abb0
509cb73
21bde03
6471f07
c14067f
20967a9
bf6d497
1a893ad
1717235
f2debe4
c191ed3
e61cef4
bb82a6b
13ee51e
b01d6b3
61c1608
f455f99
a31d6b1
98b4398
0ca848a
9442c72
f37c1eb
cea02dd
813c2d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package org.utbot.contest.usvm | ||
|
|
||
| import org.jacodb.analysis.library.analyzers.thisInstance | ||
| import org.jacodb.api.JcClassOrInterface | ||
| import org.jacodb.api.JcField | ||
| import org.jacodb.api.JcMethod | ||
| import org.jacodb.api.JcType | ||
| import org.jacodb.api.TypeName | ||
| import org.usvm.instrumentation.testcase.api.UTestInst | ||
| import org.usvm.instrumentation.testcase.descriptor.UTestObjectDescriptor | ||
| import org.usvm.instrumentation.testcase.descriptor.UTestValueDescriptor | ||
| import org.usvm.instrumentation.util.toJavaClass | ||
| import org.usvm.instrumentation.util.toJavaField | ||
| import org.utbot.framework.plugin.api.ClassId | ||
| import org.utbot.framework.plugin.api.ConstructorId | ||
| import org.utbot.framework.plugin.api.ExecutableId | ||
| import org.utbot.framework.plugin.api.FieldId | ||
| import org.utbot.framework.plugin.api.MethodId | ||
| import org.utbot.framework.plugin.api.util.fieldId | ||
| import org.utbot.framework.plugin.api.util.id | ||
| import org.utbot.framework.plugin.api.util.objectClassId | ||
| import org.utbot.framework.plugin.api.util.utContext | ||
|
|
||
| fun JcMethod.toExecutableId(): ExecutableId { | ||
| val type = this.thisInstance.type.classId | ||
| val parameters = this.parameters.map { it.type.classId } | ||
|
|
||
| if (isConstructor) { | ||
| return ConstructorId(type, parameters) | ||
| } | ||
|
|
||
| return MethodId(type, this.name, this.returnType.classId, parameters) | ||
| } | ||
|
|
||
| val JcType?.classId: ClassId | ||
| get() = this?.toJavaClass(utContext.classLoader)?.id ?: objectClassId | ||
|
||
|
|
||
| val JcClassOrInterface.classId: ClassId | ||
| get() = this.toJavaClass(utContext.classLoader).id | ||
|
|
||
| val TypeName.classId: ClassId | ||
| get() = ClassId(this.typeName) | ||
|
Comment on lines
+43
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least add |
||
|
|
||
| val JcField.fieldId: FieldId | ||
| get() = toJavaField(utContext.classLoader)!!.fieldId | ||
|
|
||
| val UTestValueDescriptor.origin: UTestInst? | ||
| get() = (this as? UTestObjectDescriptor)?.originUTestExpr | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.