From 635d9589369abf01311be48fb8d0b93f415ffc2f Mon Sep 17 00:00:00 2001 From: Alexander Clausen Date: Fri, 2 Feb 2024 14:29:41 +0100 Subject: [PATCH] WIP: try to make the test more independent of slot size --- libertem_asi_tpx3/src/chunk_stack.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libertem_asi_tpx3/src/chunk_stack.rs b/libertem_asi_tpx3/src/chunk_stack.rs index 09296328..134c2d6e 100644 --- a/libertem_asi_tpx3/src/chunk_stack.rs +++ b/libertem_asi_tpx3/src/chunk_stack.rs @@ -718,14 +718,15 @@ mod tests { assert_eq!(fs.padding_bytes, 7); assert_eq!(fs.cursor, 8); - assert!(!fs.can_fit(4096)); - assert!(fs.can_fit(4088)); + assert!(!fs.can_fit(slot_size)); + assert!(fs.can_fit(slot_size - 8)); - fs.slice_for_writing(4088, layout.clone()); + fs.slice_for_writing(slot_size - 8, layout.clone()); assert_eq!(fs.padding_bytes, 7); - assert_eq!(fs.cursor, 4096); + assert_eq!(fs.cursor, slot_size); assert!(!fs.can_fit(1)); assert!(!fs.can_fit(8)); assert!(!fs.can_fit(4096)); + assert!(!fs.can_fit(slot_size)); } }