mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 15:31:15 +00:00
virtio-devices: Use assert!() rather than if+panic
As identified by the new beta clippy. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
a3a0d26959
commit
8a56720b0f
@ -684,9 +684,10 @@ mod tests {
|
|||||||
let mut epoll_helper =
|
let mut epoll_helper =
|
||||||
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
||||||
|
|
||||||
if !ctx.handler.handle_event(&mut epoll_helper, &event) {
|
assert!(
|
||||||
panic!("handle_event() should have failed");
|
ctx.handler.handle_event(&mut epoll_helper, &event),
|
||||||
}
|
"handle_event() should have failed"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -752,9 +753,10 @@ mod tests {
|
|||||||
let mut epoll_helper =
|
let mut epoll_helper =
|
||||||
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
||||||
|
|
||||||
if !ctx.handler.handle_event(&mut epoll_helper, &event) {
|
assert!(
|
||||||
panic!("handle_event() should have failed");
|
ctx.handler.handle_event(&mut epoll_helper, &event),
|
||||||
}
|
"handle_event() should have failed"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -771,9 +773,10 @@ mod tests {
|
|||||||
let mut epoll_helper =
|
let mut epoll_helper =
|
||||||
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
||||||
|
|
||||||
if !ctx.handler.handle_event(&mut epoll_helper, &event) {
|
assert!(
|
||||||
panic!("handle_event() should have failed");
|
ctx.handler.handle_event(&mut epoll_helper, &event),
|
||||||
}
|
"handle_event() should have failed"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -842,8 +845,9 @@ mod tests {
|
|||||||
let mut epoll_helper =
|
let mut epoll_helper =
|
||||||
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
EpollHelper::new(&ctx.handler.kill_evt, &ctx.handler.pause_evt).unwrap();
|
||||||
|
|
||||||
if !ctx.handler.handle_event(&mut epoll_helper, &event) {
|
assert!(
|
||||||
panic!("handle_event() should have failed");
|
ctx.handler.handle_event(&mut epoll_helper, &event),
|
||||||
}
|
"handle_event() should have failed"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user