diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /tests/unit/audio/receive_reference_probe.f90 | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'tests/unit/audio/receive_reference_probe.f90')
| -rw-r--r-- | tests/unit/audio/receive_reference_probe.f90 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/unit/audio/receive_reference_probe.f90 b/tests/unit/audio/receive_reference_probe.f90 new file mode 100644 index 00000000..71c43acd --- /dev/null +++ b/tests/unit/audio/receive_reference_probe.f90 @@ -0,0 +1,43 @@ +! Keep the production reference-spectrum implementation in this test. This +! bridge only supplies its flags and the compiler-specific CHARACTER argument. +subroutine receive_reference_probe(id2,ninput) bind(C) + use iso_c_binding, only: c_int16_t,c_int + implicit none + integer(c_int16_t) :: id2(*) + integer(c_int), value :: ninput + logical*1 :: clear, measure, apply + + clear=.false. + measure=.true. + apply=.false. + ! One measurement per process: refspectrum writes a file every fourth call. + call refspectrum(id2,ninput,clear,measure,apply,'unused-receive-reference.dat') +end subroutine + +! Exercise the production filter-application path. Build a deterministic, +! non-identity reference file in the test process so the write footprint is +! observable without relying on a user's writable-data directory. +subroutine receive_reference_apply_probe(id2,ninput) bind(C) + use iso_c_binding, only: c_int16_t,c_int + implicit none + integer(c_int16_t) :: id2(*) + integer(c_int), value :: ninput + logical*1 :: clear, measure, apply + integer :: i + real :: frequency + character(len=*), parameter :: path='receive-reference-apply.dat' + + open(16,file=path,status='replace') + write(16,'(3i5,5e25.16)') 400,2600,5,0.d0,0.d0,0.d0,0.d0,0.d0 + do i=1,3456 + frequency=12000.0*i/6912.0 + write(16,'(f10.3,e12.3,f12.6,e12.3,f12.6)') & + frequency,1.0,0.0,0.5,20.0*log10(0.5) + enddo + close(16) + + clear=.false. + measure=.false. + apply=.true. + call refspectrum(id2,ninput,clear,measure,apply,path) +end subroutine |
