ds323x-rs/tests/construction.rs

19 lines
532 B
Rust
Raw Permalink Normal View History

2018-11-16 18:32:33 +00:00
mod common;
2020-07-10 20:42:39 +00:00
use self::common::{
destroy_ds3231, destroy_ds3232, destroy_ds3234, new_ds3231, new_ds3232, new_ds3234,
};
2018-11-16 18:32:33 +00:00
macro_rules! construction_test {
($name:ident, $create:ident, $destroy:ident) => {
#[test]
fn $name() {
let dev = $create(&[]);
$destroy(dev);
}
};
}
construction_test!(can_create_ds3231, new_ds3231, destroy_ds3231);
construction_test!(can_create_ds3232, new_ds3232, destroy_ds3232);
construction_test!(can_create_ds3234, new_ds3234, destroy_ds3234);