2024-12-19 12:49:49 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
|
|
func TestFilterConfigs(t *testing.T) {
|
2024-12-27 00:07:05 +02:00
|
|
|
cfgs := filter(Configs, func(c Config) bool {
|
|
|
|
|
return c.Name != "Preset" && c.Name != "Constant Rate Factor (CRF)"
|
|
|
|
|
})
|
2024-12-19 12:49:49 +02:00
|
|
|
|
|
|
|
|
for _, cfg := range cfgs {
|
|
|
|
|
if cfg.Name == "Preset" {
|
|
|
|
|
t.Fatalf("Failed to filter out config \"Preset\"")
|
|
|
|
|
} else if cfg.Name == "Constant Rate Factor (CRF)" {
|
|
|
|
|
t.Fatalf("Failed to filter out config \"Constant Rate Factor (CRF)\"")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestGetVisibleConfigs(t *testing.T) {
|
|
|
|
|
cfgs := getVisibleConfigs(Configs)
|
|
|
|
|
|
|
|
|
|
if len(cfgs) == len(Configs) {
|
|
|
|
|
t.Fatalf("Failed to get the correct visible configs. Expected VisibleConfigs len: %v. Got %v", 4, len(cfgs))
|
|
|
|
|
}
|
|
|
|
|
}
|