Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7392e6d

Browse files
rebase
1 parent04fe674 commit7392e6d

File tree

32 files changed

+223
-201
lines changed

32 files changed

+223
-201
lines changed

‎utbot-core/src/main/kotlin/org/utbot/common/FileUtil.kt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ object FileUtil {
9090

9191
for (clazzin classes) {
9292
val path= clazz.toClassFilePath()
93-
val resource= clazz.classLoader.getResource(path)?: error("No such file:$path")
93+
val resource=
94+
clazz.classLoader.getResource(path)
95+
?:ClassLoader.getSystemClassLoader().getResource(path)
96+
?: error("No such file:$path")
9497

9598
if (resource.toURI().scheme=="jar") {
9699
val jarLocation= resource.toURI().extractJarName()

‎utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,17 @@ object UtSettings : AbstractSettings(logger, defaultKeyForSettingsPath, defaultS
245245
/**
246246
* Set to true to use grey-box fuzzing
247247
*/
248-
var useGreyBoxFuzzing:Boolean by getBooleanProperty(true)
248+
var useGreyBoxFuzzing:Boolean by getBooleanProperty(false)
249249

250250
/**
251-
* Set to true to use grey-box fuzzingin competition mode (without asserts generation)
251+
* Set to true to useUtCompositeModels ingrey-box fuzzingprocess
252252
*/
253-
vargreyBoxFuzzingCompetitionMode:Boolean by getBooleanProperty(true)
253+
varuseCompositeModelsInGreyBoxFuzzing:Boolean by getBooleanProperty(false)
254254

255255
/**
256-
* Set to true to useUtCompositeModels ingrey-box fuzzingprocess
256+
* Set to true to use grey-box fuzzingin competition mode (without asserts generation)
257257
*/
258-
varuseCompositeModelsInGreyBoxFuzzing:Boolean by getBooleanProperty(false)
258+
vargreyBoxFuzzingCompetitionMode:Boolean by getBooleanProperty(false)
259259

260260
/**
261261
* Set the total attempts to improve coverage by fuzzer.

‎utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/UtExecutionResult.kt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packageorg.utbot.framework.plugin.api
22

3+
importorg.utbot.framework.plugin.api.util.objectClassId
34
importorg.utbot.framework.plugin.api.visible.UtStreamConsumingException
45
importjava.io.File
56
importjava.util.LinkedList
@@ -105,6 +106,11 @@ inline fun UtExecutionResult.onFailure(action: (exception: Throwable) -> Unit):
105106
returnthis
106107
}
107108

109+
fun UtExecutionResult.getOrThrow():UtModel=when (this) {
110+
isUtExecutionSuccess-> model
111+
isUtExecutionFailure->throw exception
112+
}
113+
108114
fun UtExecutionResult.exceptionOrNull():Throwable?=when (this) {
109115
isUtExecutionFailure-> rootCauseException
110116
isUtExecutionSuccess->null

‎utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/util/UtContext.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.utbot.common.currentThreadInfo
55
importorg.utbot.framework.plugin.api.util.UtContext.Companion.setUtContext
66
importkotlin.coroutines.CoroutineContext
77
importkotlinx.coroutines.ThreadContextElement
8-
//import mu.KotlinLogging
8+
importmu.KotlinLogging
99

1010
val utContext:UtContext
1111
get()=UtContext.currentContext()
@@ -75,7 +75,7 @@ inline fun <T> withUtContext(context: UtContext, block: () -> T): T = setUtConte
7575
try {
7676
return@use block.invoke()
7777
}catch (e:Exception) {
78-
//KotlinLogging.logger("withUtContext").error { e }
78+
KotlinLogging.logger("withUtContext").error { e }
7979
throw e
8080
}
8181
}

‎utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ import org.utbot.framework.UtSettings.pathSelectorStepsLimit
3232
importorg.utbot.framework.UtSettings.pathSelectorType
3333
importorg.utbot.framework.UtSettings.processUnknownStatesDuringConcreteExecution
3434
importorg.utbot.framework.UtSettings.useDebugVisualization
35-
importorg.utbot.framework.concrete.UtConcreteExecutionData
36-
importorg.utbot.framework.concrete.UtConcreteExecutionResult
37-
importorg.utbot.framework.concrete.UtExecutionInstrumentation
38-
importorg.utbot.framework.concrete.UtFuzzingExecutionInstrumentation
3935
importorg.utbot.framework.concrete.FuzzerConcreteExecutor
40-
importorg.utbot.framework.concrete.constructors.UtModelConstructor
41-
importorg.utbot.framework.concrete.phases.ValueConstructionContext
36+
importorg.utbot.framework.concrete.UtFuzzingExecutionInstrumentation
37+
importorg.utbot.framework.util.convertToAssemble
4238
importorg.utbot.framework.plugin.api.*
4339
importorg.utbot.framework.plugin.api.Step
4440
importorg.utbot.framework.plugin.api.util.*
@@ -53,6 +49,8 @@ import org.utbot.instrumentation.ConcreteExecutor
5349
importorg.utbot.instrumentation.instrumentation.execution.UtConcreteExecutionData
5450
importorg.utbot.instrumentation.instrumentation.execution.UtConcreteExecutionResult
5551
importorg.utbot.instrumentation.instrumentation.execution.UtExecutionInstrumentation
52+
importorg.utbot.instrumentation.instrumentation.execution.constructors.UtModelConstructor
53+
importorg.utbot.instrumentation.instrumentation.execution.phases.ValueConstructionContext
5654
importsoot.jimple.Stmt
5755
importsoot.tagkit.ParamNamesTag
5856
importjava.lang.reflect.Method
@@ -447,8 +445,7 @@ class UtBotSymbolicEngine(
447445
collectConstantsForGreyBoxFuzzer(methodUnderTest.sootMethod, utModelConstructor),
448446
fuzzerUtModelConstructor,
449447
FuzzerConcreteExecutor(
450-
concreteExecutor.pathsToUserClasses,
451-
concreteExecutor.pathsToDependencyClasses
448+
concreteExecutor.pathsToUserClasses
452449
)::execute,
453450
ValueConstructionContext(UtFuzzingExecutionInstrumentation.instrumentationContext,true)::constructParameters,
454451
timeBudget

‎utbot-framework/src/main/kotlin/org/utbot/external/api/UtBotJavaApi.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ object UtBotJavaApi {
7070

7171
val concreteExecutor=ConcreteExecutor(
7272
UtExecutionInstrumentation,
73-
classpath,
73+
classpath
7474
)
7575

7676
testSets.addAll(generateUnitTests(concreteExecutor, methodsForGeneration, classUnderTest))

‎utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/context/CgContext.kt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,8 @@ data class CgContext(
551551
}
552552
}
553553

554-
privatevar nestedClassIndex=0
555554
privatefuncreateClassIdForNestedClass(testClassModel:TestClassModel):ClassId {
556-
val simpleName="${testClassModel.classUnderTest.simpleName}Test${nestedClassIndex++}"
555+
val simpleName="${testClassModel.classUnderTest.simpleName}Test"
557556
returnBuiltinClassId(
558557
canonicalName= currentTestClass.canonicalName+"."+ simpleName,
559558
simpleName= simpleName,

‎utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgElement.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class CgClass(
134134
valbody:CgClassBody,
135135
valisStatic:Boolean,
136136
valisNested:Boolean,
137-
):CgStatement {
137+
):CgElement {
138138
val packageName
139139
get()= id.packageName
140140

‎utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgAbstractRenderer.kt‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -623,15 +623,7 @@ abstract class CgAbstractRenderer(
623623
isBoolean-> toStringConstant()
624624
// String is "\"" + "str" + "\"", RawString is "str"
625625
isString->if (asRawString)"$this".escapeCharacters()else toStringConstant()
626-
else-> {
627-
val t=this@toStringConstant.type
628-
val illegalType= t.toString().contains("$")||!t.isPublic
629-
if (this==null&&UtSettings.greyBoxFuzzingCompetitionMode&&!illegalType) {
630-
"(${this@toStringConstant.type}) null"
631-
}else {
632-
"$this"
633-
}
634-
}
626+
else->"$this"
635627
}
636628
}
637629

‎utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,6 @@ internal class CgJavaRenderer(context: CgRendererContext, printer: CgPrinter = C
238238
renderExceptions(element)
239239
}
240240

241-
privatefungetTypeStringRepresentation(typeId:ClassId):String=
242-
when {
243-
typeId.isArray-> getTypeStringRepresentation(typeId.elementClassId!!)+"[]"
244-
else-> typeId.toString()
245-
}
246241

247242
overridefunrenderMethodSignature(element:CgMockMethod) {
248243
val returnType= element.returnType.asString()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp