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.
This commit is contained in:
@@ -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"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user