Separate exclusive tests

pull/4/head
Diego Barrios Romero 2018-10-31 10:41:54 +01:00
parent b70f4a6ffa
commit 8734afa03f
3 changed files with 26 additions and 12 deletions

12
tests/ds3232.rs 100644
View File

@ -0,0 +1,12 @@
#[deny(warnings)]
extern crate embedded_hal_mock as hal;
extern crate ds323x;
use ds323x::Ds323x;
#[test]
fn can_create_and_destroy() {
let dev = Ds323x::new_ds3232(hal::i2c::Mock::new(&[]));
let mut i2c = dev.destroy_ds3232();
i2c.done();
}

View File

@ -45,18 +45,6 @@ macro_rules! set_param_test_2_4 {
};
}
#[test]
fn can_create_and_destroy_ds3232() {
let dev = new_ds3232(&[]);
destroy_ds3232(dev);
}
#[test]
fn can_create_and_destroy_ds3234() {
let dev = new_ds3234(&[]);
destroy_ds3234(dev);
}
const DEFAULT_WRITE_STATUS: u8 = DS323X_POR_STATUS | BF::ALARM2F | BF::ALARM1F;
call_method_status_test!(can_en_32khz_bat, enable_32khz_output_on_battery,

14
tests/ds3234.rs 100644
View File

@ -0,0 +1,14 @@
#[deny(warnings)]
extern crate embedded_hal_mock as hal;
extern crate ds323x;
#[allow(unused)]
mod common;
use common::{ new_ds3234, destroy_ds3234 };
#[test]
fn can_create_and_destroy_ds3234() {
let dev = new_ds3234(&[]);
destroy_ds3234(dev);
}