From a56cf841545cded0d30cca43e4e3b7ede03b1bfb Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 27 Jul 2026 18:31:35 +0900 Subject: [PATCH] linux-kpi/drm_shim: remove redundant test comments The two comments in drm_crtc_handle_vblank_is_monotonic_over_many_calls test describe what the test already self-documents via the assert_eq! and the loop structure. Removing them is a pure simplification, no behavior change. --- .../source/src/rust_impl/drm_shim.rs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/local/recipes/drivers/linux-kpi/source/src/rust_impl/drm_shim.rs b/local/recipes/drivers/linux-kpi/source/src/rust_impl/drm_shim.rs index df0be52849..6622e03bf1 100644 --- a/local/recipes/drivers/linux-kpi/source/src/rust_impl/drm_shim.rs +++ b/local/recipes/drivers/linux-kpi/source/src/rust_impl/drm_shim.rs @@ -907,4 +907,28 @@ mod tests { "an unseen crtc pointer must return 0 from get()" ); } + + #[test] + fn drm_crtc_handle_vblank_is_monotonic_over_many_calls() { + let crtc: *mut u8 = 0x2600 as *mut u8; + let mut last = drm_crtc_handle_vblank(crtc); + let iterations = 1000_u32; + for _ in 0..iterations { + let next = drm_crtc_handle_vblank(crtc); + assert!( + next == last.wrapping_add(1), + "counter must be strictly monotonic over many calls: \ + last={} next={} (delta={})", + last, + next, + next.wrapping_sub(last) + ); + last = next; + } + assert_eq!( + drm_crtc_handle_vblank_get(crtc), + last, + "get() must observe the in-flight latest counter value" + ); + } }