Go-based FM stereo transmitter with RDS, Windows-first and cross-platform
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

23 líneas
507B

  1. package mpx
  2. import (
  3. "math"
  4. "testing"
  5. )
  6. func TestDefaultCombinerCombine(t *testing.T) {
  7. comb := NewDefaultCombiner()
  8. value := comb.Combine(1, 0.5, 0.2, -0.1)
  9. if math.Abs(value-1.6) > 1e-9 {
  10. t.Fatalf("unexpected combined value: %v", value)
  11. }
  12. }
  13. func TestCustomGains(t *testing.T) {
  14. comb := DefaultCombiner{MonoGain: 0.5, StereoGain: 2, PilotGain: 0, RDSGain: -1}
  15. result := comb.Combine(1, 1, 1, 1)
  16. if math.Abs(result-(0.5+2+0-1)) > 1e-9 {
  17. t.Fatalf("custom gains not applied: %v", result)
  18. }
  19. }