Skip to content

Commit fbd007c

Browse files
sirhcelSh3Rm4n
authored andcommitted
Accept different errors in send_receive_wrong_baud
Even after unplugging my STM32F3DISCOVERY MB1035D for several hours, I'm getting a noise error in this test case.
1 parent de47db3 commit fbd007c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

testsuite/tests/uart.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,12 @@ mod tests {
163163
defmt::info!("{}", c);
164164
assert!(matches!(c, Err(Error::Framing)));
165165

166-
// provoke an error (framing)
167-
nb::block!(tx_fast.write(b'a'));
166+
// provoke an error (this does not seem to be absolutely deterministic
167+
// and we've seen multiple error variants in the wild)
168+
unwrap!(nb::block!(tx_fast.write(b'a')));
168169
let c = nb::block!(rx_slow.read());
169170
defmt::info!("{}", c);
170-
assert!(matches!(c, Err(Error::Framing)));
171+
assert!(matches!(c, Err(Error::Framing) | Err(Error::Noise)));
171172
}
172173

173174
// TODO: Check the parity. But currently, there is no way to configure the parity

0 commit comments

Comments
 (0)