()
| 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() { |
nothing calls this directly
no test coverage detected