From fce3d8546bd619964ec5dd1594cd93e744a99521 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Sun, 11 Nov 2018 17:32:52 +0100 Subject: Implement value conversions over type parameter --- tests/common/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') 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(dev: Ads1x1x<$iface, ic::$ic, MODE>) { + pub fn $destroy(dev: Ads1x1x<$iface, ic::$ic, $conv, MODE>) { dev.$destroy().done(); } } } -impl_new_destroy!(Ads1013, new_ads1013, destroy_ads1013, I2cTrans, interface::I2cInterface); -impl_new_destroy!(Ads1113, new_ads1113, destroy_ads1113, I2cTrans, interface::I2cInterface); -impl_new_destroy!(Ads1014, new_ads1014, destroy_ads1014, I2cTrans, interface::I2cInterface); -impl_new_destroy!(Ads1015, new_ads1015, destroy_ads1015, I2cTrans, interface::I2cInterface); +impl_new_destroy!(Ads1013, new_ads1013, destroy_ads1013, ic::Resolution12Bit, I2cTrans, interface::I2cInterface); +impl_new_destroy!(Ads1113, new_ads1113, destroy_ads1113, ic::Resolution16Bit, I2cTrans, interface::I2cInterface); +impl_new_destroy!(Ads1014, new_ads1014, destroy_ads1014, ic::Resolution12Bit, I2cTrans, interface::I2cInterface); +impl_new_destroy!(Ads1015, new_ads1015, destroy_ads1015, ic::Resolution12Bit, I2cTrans, interface::I2cInterface); #[macro_export] macro_rules! assert_would_block { -- cgit v1.2.3-54-g00ecf