Skip to content

Commit

Permalink
improved test readability
Browse files Browse the repository at this point in the history
  • Loading branch information
arcuri82 committed Dec 18, 2024
1 parent 64f1079 commit 8787bbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.evomaster.core.EMConfig
import org.evomaster.core.TestUtils
import org.evomaster.core.search.algorithms.onemax.OneMaxIndividual
import org.evomaster.core.search.algorithms.onemax.OneMaxModule
import org.evomaster.core.search.algorithms.onemax.OneMaxSampler
import org.evomaster.core.search.service.ExecutionPhaseController
import org.junit.jupiter.api.Test

Expand Down Expand Up @@ -41,7 +42,7 @@ class StandardGeneticAlgorithmTest {
epc.finishSearch()

assertTrue(solution.individuals.size == 1)
assertEquals(3.0, solution.overall.computeFitnessScore(), 0.001)
assertEquals(OneMaxSampler.DEFAULT_N.toDouble(), solution.overall.computeFitnessScore(), 0.001)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import org.evomaster.core.search.service.Sampler

class OneMaxSampler : Sampler<OneMaxIndividual>(){

var n = 3
companion object{
const val DEFAULT_N = 3
}


var n = DEFAULT_N

override fun sampleAtRandom(): OneMaxIndividual {

Expand Down

0 comments on commit 8787bbf

Please sign in to comment.