use crate::data::identification::{Address, Area, Identifier};
#[test]
fn test_address() {
let mut addr = Address::new(4096);
addr.increment();
assert_eq!(addr.to_u64(), 4097u64);
assert_eq!(addr.to_usize(), 4097usize);
}
#[test]
fn test_area() {
let start = Address::new(0x00100);
let area = Area::region(start, 0x40);
let second = area.next_address(start);
let end = area.end();
assert_eq!(start.to_u64(), 0x00100);
assert_eq!(second.to_u64(), 0x00101);
assert_eq!(end.to_u64(), 0x00140);
let start = Address::new(0x00100);
let area = Area::new(start, 4, 0x40);
let second = area.next_address(start);
let end = area.end();
assert_eq!(start.to_u64(), 0x00100);
assert_eq!(second.to_u64(), 0x00104);
assert_eq!(end.to_u64(), 0x00200);
}