Fix vacuous bounds test and stale/circular comments from the settle
Replace the self-comparing render-window loop with a genuinely discriminating floor-vs-exact check; correct two stale claims; mark the Auto/Manual floor-parity premise as unverified; drop the STARTPOS/ENDPOS comment's circular justification.
This commit is contained in:
@@ -408,14 +408,17 @@ static void testOnAndOffGridWindowsAreHonoredIdentically() {
|
||||
CHECK(on == 48000);
|
||||
CHECK(off == 48000);
|
||||
|
||||
// The discriminating half: the off-grid window is one a flooring render WOULD get
|
||||
// wrong (47992 against 48000) while the on-grid one is untouched by a floor. The
|
||||
// gate's verdict must not notice that difference at any delta.
|
||||
CHECK(msFlooredEndFrameCount(offStart, offEnd, 48000) == 47992);
|
||||
CHECK(msFlooredEndFrameCount(onStart, onEnd, 48000) == on);
|
||||
for (long long delta = -3; delta <= 3; ++delta)
|
||||
CHECK(renderHonoredBounds(on, on + delta) ==
|
||||
renderHonoredBounds(off, off + delta));
|
||||
// The discriminating half: a render that landed the FLOORED count would be
|
||||
// refused on the off-grid window (47992 against the required 48000, an
|
||||
// 8-frame gap) but honored on the on-grid one, where flooring changes
|
||||
// nothing. If the floor ever came back on the settled path, this is what
|
||||
// would start failing.
|
||||
const long long offFloored = msFlooredEndFrameCount(offStart, offEnd, 48000);
|
||||
const long long onFloored = msFlooredEndFrameCount(onStart, onEnd, 48000);
|
||||
CHECK(offFloored == 47992);
|
||||
CHECK(onFloored == on);
|
||||
CHECK(!renderHonoredBounds(off, offFloored));
|
||||
CHECK(renderHonoredBounds(on, onFloored));
|
||||
}
|
||||
|
||||
static void testOnAndOffGridAt44100WhereAMillisecondIsNotWholeFrames() {
|
||||
@@ -428,11 +431,14 @@ static void testOnAndOffGridAt44100WhereAMillisecondIsNotWholeFrames() {
|
||||
const long long off = frameCountFor(offStart, offEnd, 44100);
|
||||
CHECK(on == 44100);
|
||||
CHECK(off == 44100);
|
||||
CHECK(msFlooredEndFrameCount(offStart, offEnd, 44100) == 44092);
|
||||
CHECK(msFlooredEndFrameCount(onStart, onEnd, 44100) == on);
|
||||
for (long long delta = -3; delta <= 3; ++delta)
|
||||
CHECK(renderHonoredBounds(on, on + delta) ==
|
||||
renderHonoredBounds(off, off + delta));
|
||||
const long long offFloored = msFlooredEndFrameCount(offStart, offEnd, 44100);
|
||||
const long long onFloored = msFlooredEndFrameCount(onStart, onEnd, 44100);
|
||||
CHECK(offFloored == 44092);
|
||||
CHECK(onFloored == on);
|
||||
// Same discriminating pair as the 48 kHz case: the floor would be caught
|
||||
// off-grid and invisible on-grid, even where the grid itself isn't frame-aligned.
|
||||
CHECK(!renderHonoredBounds(off, offFloored));
|
||||
CHECK(renderHonoredBounds(on, onFloored));
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
Reference in New Issue
Block a user