From 97bbed0b4cf5d69d64154f894ceefb0f01eb3236 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 3 Nov 2026 09:09:25 -0800 Subject: [PATCH] test(moq-c): keep the open range in the raw track update test raw_track_subscription_options_and_update updated its subscription with a one-element range array while `..subscription` kept `ranges_len` at 2, so moq-c read a second range past the array's end. When the read ended after "two", the task removed itself before the test cancelled it, and the cancel returned MOQ_ERROR_TRACK_NOT_FOUND. Pass the widened range alongside the open far-ahead range with a matching length, as the test's comment intends. Co-Authored-By: Claude Opus 5.5 --- rs/moq-c/src/test.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/rs/moq-c/src/test.rs b/rs/moq-c/src/test.rs index 49864cd5ffa..9845451f147 100644 --- a/rs/moq-c/src/test.rs +++ b/rs/moq-c/src/test.rs @@ -2256,15 +2256,20 @@ fn raw_track_subscription_options_and_update() { assert_eq!(read_timestamp(frame.timestamp), Some(micros(20_000))); assert_eq!(moq_consume_track_frame_free(frame_id), 0); - let widened = [moq_range { - end: moq_anchor { - group: 3, - ..ranges[0].end + // Widen the bounded range but keep the open one, so the read stays open for the cancel. + let widened = [ + moq_range { + end: moq_anchor { + group: 3, + ..ranges[0].end + }, + ..ranges[0] }, - ..ranges[0] - }]; + ranges[1], + ]; let update = moq_subscription { ranges: widened.as_ptr(), + ranges_len: widened.len(), ..subscription }; assert_eq!(unsafe { moq_consume_track_update(consumer, &update) }, 0);