Go-based FM stereo transmitter with RDS, Windows-first and cross-platform
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
799B

  1. package app
  2. import (
  3. "os"
  4. "path/filepath"
  5. "strings"
  6. "testing"
  7. "time"
  8. cfgpkg "github.com/jan/fm-rds-tx/internal/config"
  9. )
  10. func TestRunSimulatedTransmit(t *testing.T) {
  11. cfg := cfgpkg.Default()
  12. out := filepath.Join(t.TempDir(), "simulated.iqf32")
  13. summary, err := RunSimulatedTransmit(cfg, out, 20*time.Millisecond)
  14. if err != nil {
  15. t.Fatalf("RunSimulatedTransmit failed: %v", err)
  16. }
  17. if !strings.Contains(summary, "simulated transmit") {
  18. t.Fatalf("unexpected summary: %s", summary)
  19. }
  20. if !strings.Contains(summary, "freq=") {
  21. t.Fatalf("summary missing frequency: %s", summary)
  22. }
  23. if info, err := os.Stat(out); err != nil || info.Size() == 0 {
  24. t.Fatalf("expected non-empty output file, err=%v", err)
  25. }
  26. }