summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs11
1 files changed, 6 insertions, 5 deletions
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));
}
}