cec2020: add more tests
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-02-09 23:45:04 +01:00
parent 54b4ec536a
commit 018cf070c3
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -48,3 +48,36 @@ func TestGriewank(t *testing.T) {
t.Errorf("unexpected result from Griewank, want: %f, got: %v", want, got) t.Errorf("unexpected result from Griewank, want: %f, got: %v", want, got)
} }
} }
func TestHybrid1(t *testing.T) {
in := []float64{-9.2, 10, .7, 3, -80.2843}
want := 0.00025455132345086895
got := Hybrid1(in)
if got != want {
t.Errorf("unexpected result from Hybrid1, want: %f, got: %v", want, got)
}
}
func TestHybrid2(t *testing.T) {
in := []float64{-9.2, 10, .7, 3, -80.2843}
want := 25.298615746321026
got := Hybrid2(in)
if got != want {
t.Errorf("unexpected result from Hybrid2, want: %f, got: %v", want, got)
}
}
func TestHybrid3(t *testing.T) {
in := []float64{-9.2, 10, .7, 3, -80.2843}
want := 16.298615746321026
got := Hybrid3(in)
if got != want {
t.Errorf("unexpected result from Hybrid3, want: %f, got: %v", want, got)
}
}