| 283 | } |
| 284 | |
| 285 | void 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 | |
| 309 | void test_outroDurationMs() |
| 310 | { |
no test coverage detected