Skip to content

Commit

Permalink
Fix test warnings (#2483)
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani authored Nov 7, 2024
1 parent 639853e commit 4233bdd
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions hil-test/tests/spi_full_duplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,12 @@ mod tests {
// 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.apply_config(&Config {
frequency: 80.kHz(),
..Config::default()
});
ctx.spi
.apply_config(&Config {
frequency: 80.kHz(),
..Config::default()
})
.unwrap();

// Set up a large buffer that would trigger a timeout
let dma_rx_buf = DmaRxBuf::new(ctx.rx_descriptors, ctx.rx_buffer).unwrap();
Expand All @@ -523,10 +525,12 @@ mod tests {
#[timeout(3)]
fn can_transmit_after_cancel(mut ctx: Context) {
// Slow down. At 80kHz, the transfer is supposed to take a bit over 3 seconds.
ctx.spi.apply_config(&Config {
frequency: 80.kHz(),
..Config::default()
});
ctx.spi
.apply_config(&Config {
frequency: 80.kHz(),
..Config::default()
})
.unwrap();

// Set up a large buffer that would trigger a timeout
let mut dma_rx_buf = DmaRxBuf::new(ctx.rx_descriptors, ctx.rx_buffer).unwrap();
Expand All @@ -547,7 +551,8 @@ mod tests {
spi.apply_config(&Config {
frequency: 10.MHz(),
..Config::default()
});
})
.unwrap();

let transfer = spi
.transfer(dma_rx_buf, dma_tx_buf)
Expand Down

0 comments on commit 4233bdd

Please sign in to comment.