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.

54 satır
1.4KB

  1. package gpudemod
  2. import "testing"
  3. func TestStreamingGPUStubRemainsExplicitlyUnimplemented(t *testing.T) {
  4. r := &BatchRunner{eng: &Engine{sampleRate: 4000000}, streamState: make(map[int64]*ExtractStreamState)}
  5. job := StreamingExtractJob{
  6. SignalID: 1,
  7. OffsetHz: 12500,
  8. Bandwidth: 20000,
  9. OutRate: 200000,
  10. NumTaps: 65,
  11. ConfigHash: 777,
  12. }
  13. iq := makeDeterministicIQ(1000)
  14. _, err := r.StreamingExtractGPU(iq, []StreamingExtractJob{job})
  15. if err == nil {
  16. t.Fatalf("expected not-implemented error from GPU stub")
  17. }
  18. }
  19. func TestStreamingGPUHostOracleAdvancesState(t *testing.T) {
  20. r := &BatchRunner{eng: &Engine{sampleRate: 4000000}, streamState: make(map[int64]*ExtractStreamState)}
  21. job := StreamingExtractJob{
  22. SignalID: 1,
  23. OffsetHz: 12500,
  24. Bandwidth: 20000,
  25. OutRate: 200000,
  26. NumTaps: 65,
  27. ConfigHash: 777,
  28. }
  29. iq := makeDeterministicIQ(1000)
  30. results, err := r.StreamingExtractGPUHostOracle(iq, []StreamingExtractJob{job})
  31. if err != nil {
  32. t.Fatalf("unexpected host-oracle error: %v", err)
  33. }
  34. if len(results) != 1 {
  35. t.Fatalf("expected 1 result, got %d", len(results))
  36. }
  37. state := r.streamState[1]
  38. if state == nil {
  39. t.Fatalf("expected state to be initialized")
  40. }
  41. if state.NCOPhase == 0 {
  42. t.Fatalf("expected phase to advance")
  43. }
  44. if len(state.ShiftedHistory) == 0 {
  45. t.Fatalf("expected shifted history to be updated")
  46. }
  47. if results[0].NOut == 0 {
  48. t.Fatalf("expected non-zero output count from host oracle path")
  49. }
  50. }