Wideband autonomous SDR analysis engine forked from sdr-visual-suite
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

26 lines
766B

  1. package main
  2. import (
  3. "testing"
  4. "sdr-wideband-suite/internal/classifier"
  5. "sdr-wideband-suite/internal/pipeline"
  6. )
  7. func TestDecisionCanEnableRecorderFlags(t *testing.T) {
  8. rt := &dspRuntime{}
  9. rt.cfg.Recorder.Enabled = false
  10. rt.cfg.Recorder.AutoDecode = false
  11. policy := pipeline.Policy{AutoRecordClasses: []string{"WFM"}, AutoDecodeClasses: []string{"WFM"}}
  12. decision := pipeline.DecideSignalAction(policy, pipeline.Candidate{ID: 1, Hint: "WFM"}, &classifier.Classification{ModType: classifier.ClassWFM})
  13. if decision.ShouldRecord {
  14. rt.cfg.Recorder.Enabled = true
  15. }
  16. if decision.ShouldAutoDecode {
  17. rt.cfg.Recorder.AutoDecode = true
  18. }
  19. if !rt.cfg.Recorder.Enabled || !rt.cfg.Recorder.AutoDecode {
  20. t.Fatalf("expected recorder flags to be enabled")
  21. }
  22. }