From 3b40895431490e7befa111d3398bb887f059ffd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 4 Oct 2024 11:53:53 +0200 Subject: [PATCH] Adjust test to a more realistic clock frequency --- hil-test/tests/spi_full_duplex.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hil-test/tests/spi_full_duplex.rs b/hil-test/tests/spi_full_duplex.rs index 5df30fdc5b..f9410341fe 100644 --- a/hil-test/tests/spi_full_duplex.rs +++ b/hil-test/tests/spi_full_duplex.rs @@ -488,10 +488,12 @@ mod tests { } #[test] - #[timeout(3)] + #[timeout(2)] fn cancel_stops_transaction(mut ctx: Context) { - // Slow down - ctx.spi.change_bus_frequency(100.Hz()); + // Slow down. At 80kHz, the transfer is supposed to take a bit over 3 seconds. + // This means that without working cancellation, the test case should + // fail. + ctx.spi.change_bus_frequency(80.kHz()); // Set up a large buffer that would trigger a timeout let dma_rx_buf = DmaRxBuf::new(ctx.rx_descriptors, ctx.rx_buffer).unwrap(); @@ -513,8 +515,8 @@ mod tests { #[test] #[timeout(3)] fn can_transmit_after_cancel(mut ctx: Context) { - // Slow down - ctx.spi.change_bus_frequency(100.Hz()); + // Slow down. At 80kHz, the transfer is supposed to take a bit over 3 seconds. + ctx.spi.change_bus_frequency(80.kHz()); // Set up a large buffer that would trigger a timeout let mut dma_rx_buf = DmaRxBuf::new(ctx.rx_descriptors, ctx.rx_buffer).unwrap();