Skip to content

Commit bc6d855

Browse files
committed
introducing forceNewTaints()
1 parent eccc932 commit bc6d855

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

core/src/main/kotlin/org/evomaster/core/problem/httpws/service/HttpWsSampler.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ abstract class HttpWsSampler<T> : ApiWsSampler<T>() where T : Individual{
3737
val action = randomness.choose(actionCluster).copy() as HttpWsAction
3838
action.doInitialize(randomness)
3939
action.auth = getRandomAuth(noAuthP)
40+
action.forceNewTaints()
4041
return action
4142
}
4243

core/src/main/kotlin/org/evomaster/core/search/action/Action.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.evomaster.core.search.action
33
import org.evomaster.core.search.Individual
44
import org.evomaster.core.search.StructuralElement
55
import org.evomaster.core.search.gene.Gene
6+
import org.evomaster.core.search.gene.interfaces.TaintableGene
67
import org.evomaster.core.search.service.Randomness
78
import org.slf4j.Logger
89
import org.slf4j.LoggerFactory
@@ -76,6 +77,16 @@ abstract class Action(children: List<StructuralElement>) : ActionComponent(
7677
postRandomizedChecks(randomness)
7778
}
7879

80+
fun forceNewTaints(){
81+
seeTopGenes().forEach { g ->
82+
g.flatView().forEach { r ->
83+
if(r is TaintableGene && !r.isDependentTaint()){
84+
r.forceNewTaintId()
85+
}
86+
}
87+
}
88+
}
89+
7990
fun isInitialized(): Boolean {
8091
return seeTopGenes().all { it.initialized }
8192
}
@@ -107,4 +118,4 @@ abstract class Action(children: List<StructuralElement>) : ActionComponent(
107118
* once an action is mounted inside an initialized individual
108119
*/
109120
open fun resolveTempData() : Boolean = true
110-
}
121+
}

0 commit comments

Comments
 (0)