cec2020: add TestDiscus
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b38ab3b4fa
commit
441a52b130
@ -156,6 +156,36 @@ func TestAckley(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDiscus(t *testing.T) {
|
||||||
|
testInput := []float64{
|
||||||
|
-2.7137778065280593,
|
||||||
|
-1.9789783390895765,
|
||||||
|
-4.38267902085263,
|
||||||
|
-4.617877608383319,
|
||||||
|
-2.1529909200665474,
|
||||||
|
-3.801849324611571,
|
||||||
|
2.4968697503272486,
|
||||||
|
-0.27358100201730196,
|
||||||
|
2.0444319451255977,
|
||||||
|
3.8798952350630653,
|
||||||
|
-0.6150024279011337,
|
||||||
|
2.8643010641852413,
|
||||||
|
-0.6692444051928748,
|
||||||
|
4.4649633199687475,
|
||||||
|
3.2510298731558507,
|
||||||
|
-4.2095036422081495,
|
||||||
|
-0.130882052243404,
|
||||||
|
1.2001716295708604,
|
||||||
|
-0.29427650577602193,
|
||||||
|
}
|
||||||
|
want := 7.364737863641793e+06
|
||||||
|
got := Discus(testInput)
|
||||||
|
|
||||||
|
if want != got {
|
||||||
|
t.Errorf("incorrect output, want: %f, got: %v", want, got)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestSchafferExpanded(t *testing.T) {
|
func TestSchafferExpanded(t *testing.T) {
|
||||||
testInput := []float64{
|
testInput := []float64{
|
||||||
-2.7137778065280593,
|
-2.7137778065280593,
|
||||||
|
Loading…
Reference in New Issue
Block a user