File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,28 @@ mod tests {
411
411
412
412
state. serial1 = Some ( serial) ;
413
413
}
414
+
415
+ #[ test]
416
+ fn test_disabled_overrun ( state : & mut super :: State ) {
417
+ let mut serial = state. serial1 . take ( ) . unwrap ( ) ;
418
+
419
+ serial. detect_overrun ( false ) ;
420
+ while serial. is_busy ( ) { }
421
+
422
+ // Writ the whole TEST_MSG content and check if the last bit
423
+ // is in the register.
424
+ unwrap ! ( serial. bwrite_all( & TEST_MSG ) ) ;
425
+ unwrap ! ( serial. bflush( ) ) ;
426
+ assert_eq ! (
427
+ unwrap!( nb:: block!( serial. read( ) ) ) ,
428
+ * TEST_MSG . iter( ) . rev( ) . next( ) . unwrap( )
429
+ ) ;
430
+
431
+ // enable overrun again.
432
+ serial. detect_overrun ( true ) ;
433
+
434
+ state. serial1 = Some ( serial) ;
435
+ }
414
436
}
415
437
416
438
// TODO: This maybe can be moved into a function inside the
You can’t perform that action at this time.
0 commit comments