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
4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
package org.utbot.framework.concrete
2
2
3
+ import org.objectweb.asm.Type
3
4
import org.utbot.framework.concrete.constructors.ConstructOnlyUserClassesOrCachedObjectsStrategy
4
5
import org.utbot.framework.concrete.mock.InstrumentationContext
5
6
import org.utbot.framework.concrete.phases.PhaseError
@@ -62,7 +63,7 @@ object UtFuzzingExecutionInstrumentation : UtExecutionInstrumentationWithStatsCo
62
63
63
64
// statistics collection
64
65
val coverage = statisticsCollectionContext.start { getCoverage(clazz) }.toLocalCoverage(traceHandler)
65
- val classJVMName = clazz.name.replace( ' . ' , ' / ' )
66
+ val classJVMName = Type .getInternalName(clazz )
66
67
val methodInstructions =
67
68
traceHandler.processingStorage.getMethodInstructions(classJVMName, methodSignature)
68
69
@@ -140,7 +141,7 @@ object UtFuzzingExecutionInstrumentationWithStateAfterCollection : UtExecutionIn
140
141
141
142
// statistics collection
142
143
val coverage = statisticsCollectionContext.start { getCoverage(clazz) }.toLocalCoverage(traceHandler)
143
- val classJVMName = clazz.name.replace( ' . ' , ' / ' )
144
+ val classJVMName = Type .getInternalName(clazz )
144
145
val methodInstructions =
145
146
traceHandler.processingStorage.getMethodInstructions(classJVMName, methodSignature)
146
147
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package org.utbot.greyboxfuzzer
3
3
import kotlinx.coroutines.flow.FlowCollector
4
4
import kotlinx.coroutines.flow.flow
5
5
import mu.KotlinLogging
6
+ import org.objectweb.asm.Type
6
7
import org.utbot.framework.plugin.api.*
7
8
import org.utbot.framework.plugin.api.util.isConstructor
8
9
import org.utbot.framework.plugin.api.util.isStatic
@@ -242,7 +243,7 @@ class GreyBoxFuzzer(
242
243
): Set <Instruction > {
243
244
val currentMethodCoverage = coverage.coveredInstructions
244
245
.asSequence()
245
- .filter { it.className == methodUnderTest.classId.name.replace( ' . ' , ' / ' ) }
246
+ .filter { it.className == Type .getInternalName( methodUnderTest.classId.jClass ) }
246
247
.filter { it.methodSignature == methodUnderTest.signature }
247
248
// .map { it.id }
248
249
// .filter { it in methodInstructionsIds!! }
@@ -256,7 +257,7 @@ class GreyBoxFuzzer(
256
257
methodInstructions ? : return false
257
258
val coveredInstructions =
258
259
CoverageCollector .coverage
259
- .filter { it.className == methodUnderTest.classId.name.replace( ' . ' , ' / ' ) }
260
+ .filter { it.className == Type .getInternalName( methodUnderTest.classId.jClass ) }
260
261
.filter { it.methodSignature == methodUnderTest.signature }
261
262
.toSet()
262
263
return coveredInstructions.containsAll(methodInstructions!! )
Original file line number Diff line number Diff line change 1
1
package org.utbot.greyboxfuzzer.util
2
2
3
+ import org.objectweb.asm.Type
3
4
import org.utbot.framework.plugin.api.ExecutableId
4
5
import org.utbot.framework.plugin.api.UtExecution
6
+ import org.utbot.framework.plugin.api.util.jClass
5
7
6
8
object GreyBoxFuzzingStatisticPrinter {
7
9
@@ -16,7 +18,7 @@ object GreyBoxFuzzingStatisticPrinter {
16
18
for ((method, instructions) in methodsToInstructionsNumbers) {
17
19
val coveredMethodInstructions = CoverageCollector .coverage
18
20
.asSequence()
19
- .filter { it.className == method.classId.name.replace( ' . ' , ' / ' ) }
21
+ .filter { it.className == Type .getInternalName( method.classId.jClass ) }
20
22
.filter { it.methodSignature == method.signature }
21
23
.toSet()
22
24
val coveredMethodLines = coveredMethodInstructions.map { it.lineNumber }.toSet()
Original file line number Diff line number Diff line change @@ -105,10 +105,7 @@ class GreyBoxFuzzerContest {
105
105
var testsCounter = 0
106
106
for (test in testSet) {
107
107
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} " )
112
109
statsForClass.statsForMethods.add(statsForMethod)
113
110
for (result in test.executions) {
114
111
try {
You can’t perform that action at this time.
0 commit comments