summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2020-06-22 18:12:11 +0200
committerDiego Barrios Romero <eldruin@gmail.com>2020-06-22 18:12:11 +0200
commit2095e622d7e611493794800d50d3f8e548236ff7 (patch)
tree10a0636f3139632b0ca05f481030a0ab98dfa5c5
parent53280dcaa322780ef1d9d652be2c42a8c72dbdb2 (diff)
downloadads1x1x-async-2095e622d7e611493794800d50d3f8e548236ff7.tar.gz
ads1x1x-async-2095e622d7e611493794800d50d3f8e548236ff7.tar.xz
ads1x1x-async-2095e622d7e611493794800d50d3f8e548236ff7.zip
Add unit test
-rw-r--r--src/types.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/types.rs b/src/types.rs
index 5ceabc4..2b9fc02 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -259,8 +259,8 @@ pub struct Ads1x1x<DI, IC, CONV, MODE> {
#[cfg(test)]
mod tests {
- use crate::SlaveAddr;
use crate::DEVICE_BASE_ADDRESS as ADDR;
+ use crate::{FullScaleRange, SlaveAddr};
#[test]
fn can_get_default_address() {
@@ -283,4 +283,9 @@ mod tests {
assert_eq!(0b100_1010, SlaveAddr::new_sda().addr(ADDR));
assert_eq!(0b100_1011, SlaveAddr::new_scl().addr(ADDR));
}
+
+ #[test]
+ fn default_full_scale_range() {
+ assert_eq!(FullScaleRange::Within2_048V, FullScaleRange::default());
+ }
}