diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-30 13:08:13 +0200 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-31 13:41:26 +0200 |
commit | 281e2eb97c694f4978e6d28eb51c5b8642224960 (patch) | |
tree | ba937e79cb31d1f5fdce2152be9cdd79c36dc186 | |
parent | 3cb312f7daa59715497a93ba2888a958fc5cdc4e (diff) | |
download | ads1x1x-async-281e2eb97c694f4978e6d28eb51c5b8642224960.tar.gz ads1x1x-async-281e2eb97c694f4978e6d28eb51c5b8642224960.tar.xz ads1x1x-async-281e2eb97c694f4978e6d28eb51c5b8642224960.zip |
Rename constant
-rw-r--r-- | src/lib.rs | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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)); } } |