From 1eac97eea4ec0bcef0be061a2cba93a584355283 Mon Sep 17 00:00:00 2001 From: Chuyan Zhang Date: Thu, 30 Nov 2023 02:15:06 -0800 Subject: Add real disk i/o, add mkfs.aya (not yet implemented) --- src/tests/bitmap.rs | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/tests/bitmap.rs (limited to 'src/tests/bitmap.rs') diff --git a/src/tests/bitmap.rs b/src/tests/bitmap.rs deleted file mode 100644 index 1a43f09..0000000 --- a/src/tests/bitmap.rs +++ /dev/null @@ -1,38 +0,0 @@ -use crate::tests::common; -use indexmap::IndexMap; - -#[test] -fn test_allocate() { - let mut fs = common::setup(); - for _ in 0..10 { - fs.data_bitmap.allocate().unwrap(); - } - assert!(fs.data_bitmap.deallocate(5)); - assert_eq!(fs.data_bitmap.allocate().unwrap(), 5); - assert_eq!(fs.data_bitmap.allocate().unwrap(), 11); -} - -#[test] -fn test_query() { - let mut fs = common::setup(); - for _ in 0..10 { - fs.data_bitmap.allocate().unwrap(); - } - assert_eq!(fs.data_bitmap.query(0), false); - assert_eq!(fs.data_bitmap.query(5), true); - assert_eq!(fs.data_bitmap.query(11), false); -} - -#[test] -fn test_index_map() { - let mut map: IndexMap = IndexMap::new(); - map.insert(1, 2); - map.insert(2, 3); - map.insert(3, 4); - map.insert(4, 5); - map.remove(&3); - - for (entry_index, (key, value)) in map.iter().enumerate() { - println!("index {}, key {}, value {}", entry_index, key, value); - } -} -- cgit v1.2.3-70-g09d2