Ω-W1-T5: fix two stale comments in test_waveform_view.cpp (retired proportional-round model; sweep's structural-not-behavioural role)
This commit is contained in:
@@ -244,13 +244,13 @@ static void testResolveDragFrameClamps() {
|
|||||||
CHECK(resolveDragFrame(ov, 1000, 950, 500) == 1000); // clamp high (== frameCount)
|
CHECK(resolveDragFrame(ov, 1000, 950, 500) == 1000); // clamp high (== frameCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void testResolveDragFrameRounds() {
|
static void testResolveDragFrameTruncatesAtFractionalScale() {
|
||||||
// 500px area over 1000 frames -> 2 frames/px. A +3px drag -> round(6.0)=6; the rounding is
|
// 300px area over 1000 frames -> 3.33 frames/px, so frameToX(start) -> +dx -> xToFrame
|
||||||
// at the frame centre. Use a scale where a fractional result appears.
|
// lands on the column's truncating partition rather than a whole multiple of dx.
|
||||||
const OverlayArea ov = overlayOf(Rect::ltrb(0, 0, 300, 60)); // 1000 frames / 300px = 3.33 frames/px
|
const OverlayArea ov = overlayOf(Rect::ltrb(0, 0, 300, 60));
|
||||||
// +3px -> 3*1000/300 = 10.0 -> 10 frames.
|
// frameToX(100) = 30; xToFrame(30 + 3) = 33*1000/300 = 110.0 -> 110 frames.
|
||||||
CHECK(resolveDragFrame(ov, 1000, 100, 3) == 110);
|
CHECK(resolveDragFrame(ov, 1000, 100, 3) == 110);
|
||||||
// +1px -> 1000/300 = 3.33 -> rounds to 3.
|
// frameToX(100) = 30; xToFrame(30 + 1) = 31*1000/300 = 103.33 -> truncates to 103.
|
||||||
CHECK(resolveDragFrame(ov, 1000, 100, 1) == 103);
|
CHECK(resolveDragFrame(ov, 1000, 100, 1) == 103);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,8 +279,10 @@ static void testResolveDragFrameLandsOnCursorColumn() {
|
|||||||
const std::int64_t cursorFrame = xToFrame(ov, frameCount, grabX + dx);
|
const std::int64_t cursorFrame = xToFrame(ov, frameCount, grabX + dx);
|
||||||
CHECK(cursorFrame == 11); // the contract's own derivation
|
CHECK(cursorFrame == 11); // the contract's own derivation
|
||||||
CHECK(resolveDragFrame(ov, frameCount, startFrame, dx) == cursorFrame);
|
CHECK(resolveDragFrame(ov, frameCount, startFrame, dx) == cursorFrame);
|
||||||
// General form, swept across both frames<columns and frames>columns: the resolved frame's
|
// Structural coverage, not behavioural: this sweep asserts resolveDragFrame's own definition
|
||||||
// OWN column (frameToX) must contain the cursor pixel the drag actually landed on.
|
// (frameToX then xToFrame) and cannot fail while it calls those two functions. Its value is
|
||||||
|
// pinning that there is no second, independent mapping hiding in some frames<columns or
|
||||||
|
// frames>columns corner — the single behavioural anchor is the literal 11 above.
|
||||||
const std::int64_t counts[] = {5, 37, 251, 9973};
|
const std::int64_t counts[] = {5, 37, 251, 9973};
|
||||||
const int deltas[] = {-97, -3, -1, 1, 3, 97};
|
const int deltas[] = {-97, -3, -1, 1, 3, 97};
|
||||||
for (std::int64_t n : counts) {
|
for (std::int64_t n : counts) {
|
||||||
@@ -815,7 +817,7 @@ int main() {
|
|||||||
|
|
||||||
testResolveDragFrameShift();
|
testResolveDragFrameShift();
|
||||||
testResolveDragFrameClamps();
|
testResolveDragFrameClamps();
|
||||||
testResolveDragFrameRounds();
|
testResolveDragFrameTruncatesAtFractionalScale();
|
||||||
testResolveDragFrameDegenerate();
|
testResolveDragFrameDegenerate();
|
||||||
testResolveDragFrameLandsOnCursorColumn();
|
testResolveDragFrameLandsOnCursorColumn();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user