Wideband autonomous SDR analysis engine forked from sdr-visual-suite
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

46 satır
1.3KB

  1. package pipeline
  2. import (
  3. "testing"
  4. "sdr-wideband-suite/internal/detector"
  5. )
  6. func TestRefinementResultCarriesDecisions(t *testing.T) {
  7. res := RefinementResult{
  8. Signals: []detector.Signal{{ID: 1}},
  9. Decisions: []SignalDecision{{ShouldRecord: true}},
  10. Candidates: []Candidate{{ID: 1}},
  11. }
  12. if len(res.Signals) != 1 || len(res.Decisions) != 1 || len(res.Candidates) != 1 {
  13. t.Fatalf("unexpected refinement result: %+v", res)
  14. }
  15. }
  16. func TestSurveillanceResultCarriesScheduledCandidates(t *testing.T) {
  17. res := SurveillanceResult{
  18. Candidates: []Candidate{{ID: 1}},
  19. Scheduled: []ScheduledCandidate{{Candidate: Candidate{ID: 1}, Priority: 10}},
  20. }
  21. if len(res.Candidates) != 1 || len(res.Scheduled) != 1 {
  22. t.Fatalf("unexpected surveillance result: %+v", res)
  23. }
  24. }
  25. func TestRefinementInputCarriesScheduledCandidates(t *testing.T) {
  26. res := RefinementInput{
  27. Candidates: []Candidate{{ID: 2}},
  28. Scheduled: []ScheduledCandidate{{Candidate: Candidate{ID: 2}, Priority: 4}},
  29. SampleRate: 2048000,
  30. FFTSize: 2048,
  31. CenterHz: 7.1e6,
  32. Source: "surveillance-detector",
  33. }
  34. if len(res.Candidates) != 1 || len(res.Scheduled) != 1 {
  35. t.Fatalf("unexpected refinement input: %+v", res)
  36. }
  37. if res.SampleRate != 2048000 || res.FFTSize != 2048 || res.CenterHz != 7.1e6 {
  38. t.Fatalf("unexpected refinement input fields: %+v", res)
  39. }
  40. }