From 281e2eb97c694f4978e6d28eb51c5b8642224960 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Sat, 30 Mar 2019 13:08:13 +0200 Subject: Rename constant --- src/lib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 1422277..c6716b9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -502,19 +502,20 @@ mod private { #[cfg(test)] mod tests { + use super::DEVICE_BASE_ADDRESS as ADDR; use super::*; #[test] fn can_get_default_address() { let addr = SlaveAddr::default(); - assert_eq!(DEVICE_BASE_ADDRESS, addr.addr(DEVICE_BASE_ADDRESS)); + assert_eq!(ADDR, addr.addr(ADDR)); } #[test] fn can_generate_alternative_addresses() { - assert_eq!(0b100_1000, SlaveAddr::Alternative(false, false).addr(DEVICE_BASE_ADDRESS)); - assert_eq!(0b100_1001, SlaveAddr::Alternative(false, true).addr(DEVICE_BASE_ADDRESS)); - assert_eq!(0b100_1010, SlaveAddr::Alternative(true, false).addr(DEVICE_BASE_ADDRESS)); - assert_eq!(0b100_1011, SlaveAddr::Alternative(true, true).addr(DEVICE_BASE_ADDRESS)); + assert_eq!(0b100_1000, SlaveAddr::Alternative(false, false).addr(ADDR)); + assert_eq!(0b100_1001, SlaveAddr::Alternative(false, true).addr(ADDR)); + assert_eq!(0b100_1010, SlaveAddr::Alternative(true, false).addr(ADDR)); + assert_eq!(0b100_1011, SlaveAddr::Alternative(true, true).addr(ADDR)); } } -- cgit v1.2.3-54-g00ecf