MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / require_range_covered

Function require_range_covered

tests/unittests/test_audio_chunking.cpp:103–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void require_range_covered(
104 const std::vector<engine::runtime::TimeSpan> & chunks,
105 int64_t start,
106 int64_t end,
107 const std::string & label) {
108 int64_t cursor = start;
109 for (const auto & chunk : chunks) {
110 if (chunk.end_sample <= cursor) {
111 continue;
112 }
113 if (chunk.start_sample > cursor) {
114 break;
115 }
116 cursor = std::max(cursor, std::min(chunk.end_sample, end));
117 if (cursor >= end) {
118 return;
119 }
120 }
121 engine::test::require(false, label + " range is not fully covered");
122}
123
124void require_no_forbidden_gap_inside_chunks(
125 const std::vector<engine::runtime::TimeSpan> & chunks,

Calls 3

maxFunction · 0.85
minFunction · 0.85
requireFunction · 0.70

Tested by

no test coverage detected