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

Function test_evq_event

virtio-devices/src/vsock/device.rs:847–865  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

845
846 #[test]
847 fn test_evq_event() {
848 // Test case: spurious EVQ_EVENT.
849 {
850 let test_ctx = TestContext::new();
851 let mut ctx = test_ctx.create_epoll_handler_context();
852 ctx.handler.backend.write().unwrap().set_pending_rx(false);
853
854 let events = epoll::Events::EPOLLIN;
855 let event = epoll::Event::new(events, EVT_QUEUE_EVENT as u64);
856 let mut epoll_helper =
857 EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
858
859 assert_eq!(ctx.guest_evvq.used.idx.get(), 0);
860
861 ctx.handler
862 .handle_event(&mut epoll_helper, &event)
863 .expect_err("handle_event() should have failed");
864 }
865 }
866
867 #[test]
868 fn test_backend_event() {

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
set_pending_rxMethod · 0.80
writeMethod · 0.45
handle_eventMethod · 0.45

Tested by

no test coverage detected