diff options
Diffstat (limited to 'tests/mux.rs')
-rw-r--r-- | tests/mux.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/mux.rs b/tests/mux.rs index ac335b5..1b2575b 100644 --- a/tests/mux.rs +++ b/tests/mux.rs @@ -13,8 +13,8 @@ macro_rules! mux_test { mod $name { use super::*; - #[test] - fn can_read() { + #[futures_test::test] + async fn can_read() { let default_config = Config::default(); let config = Config::default().with_high(BF::OS).with_high($config_bits); let transactions = [ @@ -32,13 +32,13 @@ macro_rules! mux_test { I2cTrans::write_read(DEV_ADDR, vec![Register::CONVERSION], vec![0x80, 0x00]), ]; let mut dev = new(&transactions); - let measurement = block!(dev.read(channel::$CS)).unwrap(); + let measurement = block!(dev.read(channel::$CS).await).unwrap(); assert_eq!(-2048, measurement); destroy(dev); } - #[test] - fn read_then_read_different_triggers_new_measurement() { + #[futures_test::test] + async fn read_then_read_different_triggers_new_measurement() { let default_config = Config::default(); let config = Config::default().with_high(BF::OS).with_high($config_bits); let other_config = Config::default().with_high($other_config_bits); @@ -66,14 +66,14 @@ macro_rules! mux_test { I2cTrans::write_read(DEV_ADDR, vec![Register::CONVERSION], vec![0x80, 0x00]), ]; let mut dev = new(&transactions); - assert_would_block!(dev.read(channel::$CS)); - let measurement = block!(dev.read(channel::$other_CS)).unwrap(); + assert_would_block!(dev.read(channel::$CS).await); + let measurement = block!(dev.read(channel::$other_CS).await).unwrap(); assert_eq!(-2048, measurement); destroy(dev); } - #[test] - fn continuous_can_select_channel() { + #[futures_test::test] + async fn continuous_can_select_channel() { let config1 = Config::default().with_low(BF::OP_MODE); let config2 = config1.with_high($config_bits); let transactions = [ @@ -87,8 +87,8 @@ macro_rules! mux_test { ), ]; let dev = new(&transactions); - let mut dev = dev.into_continuous().ok().unwrap(); - dev.select_channel(channel::$CS).unwrap(); + let mut dev = dev.into_continuous().await.ok().unwrap(); + dev.select_channel(channel::$CS).await.unwrap(); destroy(dev); } } |