MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / test_termios_flush

Function test_termios_flush

tests/termios/termios.rs:2–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1#[test]
2fn test_termios_flush() {
3 use rustix::pty::*;
4 use rustix::termios::*;
5
6 let pty = match openpt(OpenptFlags::empty()) {
7 Ok(pty) => pty,
8 Err(rustix::io::Errno::NOSYS) => return,
9 Err(err) => panic!("{:?}", err),
10 };
11 let tio = match tcgetattr(&pty) {
12 Ok(tio) => tio,
13 Err(rustix::io::Errno::NOSYS) => return,
14 #[cfg(apple)]
15 Err(rustix::io::Errno::NOTTY) => return,
16 Err(err) => panic!("{:?}", err),
17 };
18 tcsetattr(&pty, OptionalActions::Now, &tio).unwrap();
19
20 tcflush(&pty, QueueSelector::IOFlush).unwrap();
21}
22
23#[test]
24fn test_termios_drain() {

Callers

nothing calls this directly

Calls 4

openptFunction · 0.50
tcgetattrFunction · 0.50
tcsetattrFunction · 0.50
tcflushFunction · 0.50

Tested by

no test coverage detected