use crate::tests::common; #[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); }