]>
Commit | Line | Data |
---|---|---|
487cf647 FG |
1 | use super::*; |
2 | ||
3 | #[test] | |
4 | fn uninit_mask() { | |
5 | let mut mask = InitMask::new(Size::from_bytes(500), false); | |
6 | assert!(!mask.get(Size::from_bytes(499))); | |
7 | mask.set_range(alloc_range(Size::from_bytes(499), Size::from_bytes(1)), true); | |
8 | assert!(mask.get(Size::from_bytes(499))); | |
9 | mask.set_range((100..256).into(), true); | |
10 | for i in 0..100 { | |
11 | assert!(!mask.get(Size::from_bytes(i)), "{i} should not be set"); | |
12 | } | |
13 | for i in 100..256 { | |
14 | assert!(mask.get(Size::from_bytes(i)), "{i} should be set"); | |
15 | } | |
16 | for i in 256..499 { | |
17 | assert!(!mask.get(Size::from_bytes(i)), "{i} should not be set"); | |
18 | } | |
19 | } |