diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-11 17:32:52 +0100 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-11 17:32:52 +0100 |
commit | fce3d8546bd619964ec5dd1594cd93e744a99521 (patch) | |
tree | 7bc17d465652c86b25b9fb34ccd7ed3bf0218b56 /tests | |
parent | b9b5349b4b78a5d59be4a7e4a11f712e2f6a8256 (diff) | |
download | ads1x1x-async-fce3d8546bd619964ec5dd1594cd93e744a99521.tar.gz ads1x1x-async-fce3d8546bd619964ec5dd1594cd93e744a99521.tar.xz ads1x1x-async-fce3d8546bd619964ec5dd1594cd93e744a99521.zip |
Implement value conversions over type parameter
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 886967c..ab629c3 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -58,23 +58,23 @@ impl Default for Config { } macro_rules! impl_new_destroy { - ($ic:ident, $create:ident, $destroy:ident, $trans:ty, $iface:ty) => { + ($ic:ident, $create:ident, $destroy:ident, $conv:ty, $trans:ty, $iface:ty) => { #[allow(unused)] - pub fn $create(transactions: &[$trans]) -> Ads1x1x<$iface, ic::$ic, mode::OneShot> { + pub fn $create(transactions: &[$trans]) -> Ads1x1x<$iface, ic::$ic, $conv, mode::OneShot> { Ads1x1x::$create(I2cMock::new(&transactions), SlaveAddr::default()) } #[allow(unused)] - pub fn $destroy<MODE>(dev: Ads1x1x<$iface, ic::$ic, MODE>) { + pub fn $destroy<MODE>(dev: Ads1x1x<$iface, ic::$ic, $conv, MODE>) { dev.$destroy().done(); } } } -impl_new_destroy!(Ads1013, new_ads1013, destroy_ads1013, I2cTrans, interface::I2cInterface<I2cMock>); -impl_new_destroy!(Ads1113, new_ads1113, destroy_ads1113, I2cTrans, interface::I2cInterface<I2cMock>); -impl_new_destroy!(Ads1014, new_ads1014, destroy_ads1014, I2cTrans, interface::I2cInterface<I2cMock>); -impl_new_destroy!(Ads1015, new_ads1015, destroy_ads1015, I2cTrans, interface::I2cInterface<I2cMock>); +impl_new_destroy!(Ads1013, new_ads1013, destroy_ads1013, ic::Resolution12Bit, I2cTrans, interface::I2cInterface<I2cMock>); +impl_new_destroy!(Ads1113, new_ads1113, destroy_ads1113, ic::Resolution16Bit, I2cTrans, interface::I2cInterface<I2cMock>); +impl_new_destroy!(Ads1014, new_ads1014, destroy_ads1014, ic::Resolution12Bit, I2cTrans, interface::I2cInterface<I2cMock>); +impl_new_destroy!(Ads1015, new_ads1015, destroy_ads1015, ic::Resolution12Bit, I2cTrans, interface::I2cInterface<I2cMock>); #[macro_export] macro_rules! assert_would_block { |