Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

test(compositor): the stale-ready test holds every slot but the last, whatever the ring size

EtienneLescot0bbc8cc4e544
diff --git a/crates/compositor/src/shared_frames.rs b/crates/compositor/src/shared_frames.rs
index cbc6eda8a..cee094618 100644
--- a/crates/compositor/src/shared_frames.rs
+++ b/crates/compositor/src/shared_frames.rs
@@ -298,8 +298,9 @@ mod tests {
book.publish(frame(u64::from(slot) + 1, slot));
book.take(u64::from(slot), now);
}
- book.publish(frame(9, 3));
- assert_eq!(book.claim(RING_SLOTS), Some(3));
+ let last = RING_SLOTS - 1;
+ book.publish(frame(u64::from(RING_SLOTS) + 1, last));
+ assert_eq!(book.claim(RING_SLOTS), Some(last));
// Retirée : la livrer maintenant, pendant qu'on la réécrit, donnerait une image déchirée.
assert_eq!(book.take(0, now), None);
}