impact80_test.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package rgb
  2. import (
  3. "testing"
  4. "netdome.biz/paul/qmk-rgb/internal/via"
  5. )
  6. func TestImpact80CatalogHasTheVendorEffectFamilies(t *testing.T) {
  7. catalog, ok := CatalogFor(0x36B0, 0x309F)
  8. if !ok {
  9. t.Fatal("CatalogFor() = not found")
  10. }
  11. logoWant := []string{"none", "wave", "fixed_wave", "spectrum", "breathing", "light", "shutdown"}
  12. for id, want := range logoWant {
  13. if got := catalog.EffectName(via.ChannelRgblight, uint8(id)); got != want {
  14. t.Errorf("logo effect %d = %q, want %q", id, got, want)
  15. }
  16. }
  17. backlightWant := map[int]string{
  18. 0: "none", 1: "solid_color", 5: "breathing", 17: "rainbow_moving_chevron",
  19. 29: "pixel_flow", 37: "solid_reactive_multinexus", 45: "riverflow",
  20. }
  21. for id, want := range backlightWant {
  22. if got := catalog.EffectName(via.ChannelRgbMatrix, uint8(id)); got != want {
  23. t.Errorf("backlight effect %d = %q, want %q", id, got, want)
  24. }
  25. }
  26. }
  27. func TestImpact80LogoAndSideShareTheirEffectFamily(t *testing.T) {
  28. catalog, _ := CatalogFor(0x36B0, 0x309F)
  29. logo := catalog.Names(via.ChannelRgblight)
  30. side := catalog.Names(via.ChannelAudio)
  31. if len(logo) != len(side) {
  32. t.Fatalf("logo has %d effects, side has %d", len(logo), len(side))
  33. }
  34. for i := range logo {
  35. if logo[i] != side[i] {
  36. t.Errorf("effect %d: logo %q, side %q", i, logo[i], side[i])
  37. }
  38. }
  39. }