File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/concrete
utbot-greyboxfuzzer/src/main/kotlin/org/utbot/greyboxfuzzer
utbot-junit-contest/src/main/kotlin/org/utbot/contest Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11package org.utbot.framework.concrete
22
3+ import org.objectweb.asm.Type
34import org.utbot.framework.concrete.constructors.ConstructOnlyUserClassesOrCachedObjectsStrategy
45import org.utbot.framework.concrete.mock.InstrumentationContext
56import org.utbot.framework.concrete.phases.PhaseError
@@ -62,7 +63,7 @@ object UtFuzzingExecutionInstrumentation : UtExecutionInstrumentationWithStatsCo
6263
6364 // statistics collection
6465 val coverage = statisticsCollectionContext.start { getCoverage(clazz) }.toLocalCoverage(traceHandler)
65- val classJVMName = clazz.name.replace( ' . ' , ' / ' )
66+ val classJVMName = Type .getInternalName(clazz )
6667 val methodInstructions =
6768 traceHandler.processingStorage.getMethodInstructions(classJVMName, methodSignature)
6869
@@ -140,7 +141,7 @@ object UtFuzzingExecutionInstrumentationWithStateAfterCollection : UtExecutionIn
140141
141142 // statistics collection
142143 val coverage = statisticsCollectionContext.start { getCoverage(clazz) }.toLocalCoverage(traceHandler)
143- val classJVMName = clazz.name.replace( ' . ' , ' / ' )
144+ val classJVMName = Type .getInternalName(clazz )
144145 val methodInstructions =
145146 traceHandler.processingStorage.getMethodInstructions(classJVMName, methodSignature)
146147
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package org.utbot.greyboxfuzzer
33import kotlinx.coroutines.flow.FlowCollector
44import kotlinx.coroutines.flow.flow
55import mu.KotlinLogging
6+ import org.objectweb.asm.Type
67import org.utbot.framework.plugin.api.*
78import org.utbot.framework.plugin.api.util.isConstructor
89import org.utbot.framework.plugin.api.util.isStatic
@@ -242,7 +243,7 @@ class GreyBoxFuzzer(
242243 ): Set <Instruction > {
243244 val currentMethodCoverage = coverage.coveredInstructions
244245 .asSequence()
245- .filter { it.className == methodUnderTest.classId.name.replace( ' . ' , ' / ' ) }
246+ .filter { it.className == Type .getInternalName( methodUnderTest.classId.jClass ) }
246247 .filter { it.methodSignature == methodUnderTest.signature }
247248// .map { it.id }
248249 // .filter { it in methodInstructionsIds!! }
@@ -256,7 +257,7 @@ class GreyBoxFuzzer(
256257 methodInstructions ? : return false
257258 val coveredInstructions =
258259 CoverageCollector .coverage
259- .filter { it.className == methodUnderTest.classId.name.replace( ' . ' , ' / ' ) }
260+ .filter { it.className == Type .getInternalName( methodUnderTest.classId.jClass ) }
260261 .filter { it.methodSignature == methodUnderTest.signature }
261262 .toSet()
262263 return coveredInstructions.containsAll(methodInstructions!! )
Original file line number Diff line number Diff line change 11package org.utbot.greyboxfuzzer.util
22
3+ import org.objectweb.asm.Type
34import org.utbot.framework.plugin.api.ExecutableId
45import org.utbot.framework.plugin.api.UtExecution
6+ import org.utbot.framework.plugin.api.util.jClass
57
68object GreyBoxFuzzingStatisticPrinter {
79
@@ -16,7 +18,7 @@ object GreyBoxFuzzingStatisticPrinter {
1618 for ((method, instructions) in methodsToInstructionsNumbers) {
1719 val coveredMethodInstructions = CoverageCollector .coverage
1820 .asSequence()
19- .filter { it.className == method.classId.name.replace( ' . ' , ' / ' ) }
21+ .filter { it.className == Type .getInternalName( method.classId.jClass ) }
2022 .filter { it.methodSignature == method.signature }
2123 .toSet()
2224 val coveredMethodLines = coveredMethodInstructions.map { it.lineNumber }.toSet()
Original file line number Diff line number Diff line change @@ -105,10 +105,7 @@ class GreyBoxFuzzerContest {
105105 var testsCounter = 0
106106 for (test in testSet) {
107107 val method = test.method
108- val statsForMethod = StatsForMethod (
109- " ${method.classId.simpleName} #${method.name} #${method.signature} " ,
110- Type .getInternalName(method.classId.jClass)
111- )
108+ val statsForMethod = StatsForMethod (" ${method.classId.simpleName} #${method.name} " )
112109 statsForClass.statsForMethods.add(statsForMethod)
113110 for (result in test.executions) {
114111 try {
You can’t perform that action at this time.
0 commit comments