Skip to content

Commit

Permalink
Fail at the first mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Aug 15, 2024
1 parent 529ee74 commit c7568f3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions hil-test/tests/i2s_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,13 @@ mod tests {
let mut rcv = [0u8; BUFFER_SIZE];
let mut sample_idx = 0;
let mut samples = SampleSource::new();
let mut success = true;
for _ in 0..30 {
let len = rx_transfer.pop(&mut rcv).await.unwrap();
for &b in &rcv[..len] {
let expected = samples.next().unwrap();
if b != expected {
success = false;
defmt::error!("Sample #{} does not match ({} != {})", sample_idx, b, expected);
}
assert_eq!(b, expected, "Sample #{} does not match ({} != {})", sample_idx, b, expected);
sample_idx += 1;
}
}

assert!(success);
}
}

0 comments on commit c7568f3

Please sign in to comment.