MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / test_morseBKEncodesCorrectElements

Function test_morseBKEncodesCorrectElements

tests/client_quindar_test.cpp:285–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void test_morseBKEncodesCorrectElements()
286{
287 ClientQuindarTone q;
288 q.prepare(kSampleRate);
289 q.setEnabled(true);
290 q.setStyle(Style::Morse);
291 q.setMorseWpm(45);
292 q.setLevelDb(0.0f);
293
294 // Skip to Live then start outro.
295 q.startIntro();
296 runUntilIdle(q, 8000);
297 q.startOutro();
298 auto out = runUntilIdle(q, 16000);
299
300 // BK = 21 dot-units at 1200/45 ≈ 26.67 ms each → ~560 ms.
301 // = 13440 frames at 24 kHz. Allow ±15 % slop.
302 const int produced = static_cast<int>(out.size() / 2);
303 char detail[160];
304 std::snprintf(detail, sizeof(detail), "frames=%d", produced);
305 report("Morse BK duration ~560 ms (13440 frames ±15 %)",
306 produced > 11400 && produced < 15500, detail);
307}
308
309void test_outroDurationMs()
310{

Callers 1

mainFunction · 0.85

Calls 10

runUntilIdleFunction · 0.85
setStyleMethod · 0.80
setMorseWpmMethod · 0.80
startIntroMethod · 0.80
startOutroMethod · 0.80
reportFunction · 0.70
prepareMethod · 0.45
setEnabledMethod · 0.45
setLevelDbMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected