From f7449a21140c109567fa6c756dab2b1b0711a414 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 3 May 2020 12:29:24 -0700 Subject: add AddressDiff, CHANGELOG, and bump to 0.0.4 --- tests/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/lib.rs (limited to 'tests') diff --git a/tests/lib.rs b/tests/lib.rs new file mode 100644 index 0000000..15477f7 --- /dev/null +++ b/tests/lib.rs @@ -0,0 +1,12 @@ +#![no_std] + +use yaxpeax_arch::AddressBase; + +#[test] +fn test_u16() { + for l in 0..100 { + for r in 0..=core::u16::MAX { + assert_eq!(r.wrapping_offset(l.diff(&r).expect("u16 addresses always have valid diffs")), l); + } + } +} -- cgit v1.1