From 856c4a9e68782bc64d3f57edd2f9c3378313b9a4 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Sat, 19 Dec 2020 23:19:49 +0200 Subject: [PATCH] Fix PhysAddr test --- nucleus/src/arch/aarch64/memory/addr/phys_addr.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nucleus/src/arch/aarch64/memory/addr/phys_addr.rs b/nucleus/src/arch/aarch64/memory/addr/phys_addr.rs index 4ca8ff0..4e29e58 100644 --- a/nucleus/src/arch/aarch64/memory/addr/phys_addr.rs +++ b/nucleus/src/arch/aarch64/memory/addr/phys_addr.rs @@ -29,7 +29,7 @@ pub struct PhysAddr(u64); /// A passed `u64` was not a valid physical address. /// /// This means that bits 52 to 64 were not all null. -#[derive(Debug)] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)] pub struct PhysAddrNotValid(u64); impl PhysAddr { @@ -240,12 +240,9 @@ mod tests { #[test_case] pub fn test_invalid_phys_addr() { - let result = PhysAddr::try_new(0xfafa_0123_0123_0123_3210_3210_3210_3210); + let result = PhysAddr::try_new(0xfafa_0123_3210_3210); if let Err(e) = result { - assert_eq!( - e, - PhysAddrNotValid(0xfafa_0123_0123_0123_3210_3210_3210_3210) - ); + assert_eq!(e, PhysAddrNotValid(0xfafa_0123_3210_3210)); } else { assert!(false) }