MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / serial_scratch

Function serial_scratch

devices/src/legacy/serial.rs:536–549  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

534
535 #[test]
536 fn serial_scratch() {
537 let intr_evt = EventFd::new(0).unwrap();
538 let mut serial = Serial::new_sink(
539 String::from(SERIAL_NAME),
540 Arc::new(TestInterrupt::new(intr_evt.try_clone().unwrap())),
541 None,
542 );
543
544 serial.write(0, SCR as u64, &[0x12]);
545
546 let mut data = [0u8];
547 serial.read(0, SCR as u64, &mut data[..]);
548 assert_eq!(data[0], 0x12);
549 }
550}

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
try_cloneMethod · 0.45
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected