Skip to content

Commit e2eface

Browse files
committed
Remove comments about bugs in DataTracker
These were relevant during development as TODOs, but have since been resolved, but the tests were not updated. Added sufficient assertions to validate that the code behaves as expected regarding merging additional TSN blocks.
1 parent 2fa5ff2 commit e2eface

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/rx/data_tracker.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,9 @@ mod tests {
12481248
// Create two separate blocks: 12-13 and 15-16
12491249
observe(&mut d, now, &[12, 13, 15, 16]);
12501250
// Now fill the gap between them with 14. This should merge the blocks.
1251-
// The current implementation of `add_additional_tsn` is buggy and will
1252-
// result in `[12..14, 14..17]`.
12531251
observe(&mut d, now, &[14]);
1252+
assert_eq!(d.additional_tsn_blocks, vec![Tsn(12)..Tsn(17)]);
1253+
12541254
// Now receive 11, which should advance the cumulative ack over all blocks.
12551255
observe(&mut d, now, &[11]);
12561256

@@ -1268,21 +1268,20 @@ mod tests {
12681268
// Create two separate blocks: 13 and 15.
12691269
// State: additional_tsn_blocks = [13..14, 15..16]
12701270
observe(&mut d, now, &[13, 15]);
1271+
assert_eq!(d.additional_tsn_blocks, vec![Tsn(13)..Tsn(14), Tsn(15)..Tsn(16)]);
12711272

12721273
// Fill the gap between them with 14.
1273-
// This hits a bug in `add_additional_tsn` where expanding a block to the left
1274-
// doesn't check if it can merge with the block before it, resulting in adjacent blocks.
1275-
// State: additional_tsn_blocks = [13..14, 14..16]
12761274
observe(&mut d, now, &[14]);
1275+
assert_eq!(d.additional_tsn_blocks, vec![Tsn(13)..Tsn(16)]);
12771276

12781277
// Add 12, which expands the first block to the left.
1279-
// State: additional_tsn_blocks = [12..14, 14..16]
12801278
observe(&mut d, now, &[12]);
1279+
assert_eq!(d.additional_tsn_blocks, vec![Tsn(12)..Tsn(16)]);
12811280

12821281
// Now receive 11, which should advance the cumulative ack over all blocks.
1283-
// But `observe` only processes one block, leaving last_cumulative_acked_tsn
1284-
// at 13 instead of 15.
12851282
observe(&mut d, now, &[11]);
1283+
assert_eq!(d.last_cumulative_acked_tsn, Tsn(15));
1284+
assert_eq!(d.additional_tsn_blocks, vec![]);
12861285

12871286
let sack = d.create_selective_ack(A_RWND);
12881287
assert_eq!(sack.cumulative_tsn_ack, Tsn(15));

0 commit comments

Comments
 (0)