mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: vsock: fix two clippy warnings
The mem_size field is not needed in TestContext. Drop it. Make sure guest_evvq is read once. Clippy cannot figured out that it was used. While at it, add an extra assert for the spurious rxvq event test, too. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -782,6 +782,7 @@ mod tests {
|
||||
let mut epoll_helper =
|
||||
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
||||
|
||||
assert_eq!(ctx.guest_rxvq.used.idx.get(), 0);
|
||||
assert!(
|
||||
ctx.handler.handle_event(&mut epoll_helper, &event).is_err(),
|
||||
"handle_event() should have failed"
|
||||
@@ -802,6 +803,7 @@ mod tests {
|
||||
let mut epoll_helper =
|
||||
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
||||
|
||||
assert_eq!(ctx.guest_evvq.used.idx.get(), 0);
|
||||
assert!(
|
||||
ctx.handler.handle_event(&mut epoll_helper, &event).is_err(),
|
||||
"handle_event() should have failed"
|
||||
|
||||
Reference in New Issue
Block a user