mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-03 22:58:17 +00:00
fix(testsuite): fix clippy::useless_conversion
And fix the test. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
8309457b7e
commit
d36391c164
1 changed files with 19 additions and 8 deletions
|
@ -98,24 +98,33 @@ fn smoke_keyboard() {
|
|||
(None, None) => {}
|
||||
(None, Some(_)) => unreachable!(),
|
||||
(Some(pressed_packet), None) => {
|
||||
if let FastPathInputEvent::KeyboardEvent(flags, scancode) = pressed_packet {
|
||||
if let FastPathInputEvent::KeyboardEvent(flags, packet_scancode) = pressed_packet {
|
||||
ensure!(!flags.contains(KeyboardFlags::RELEASE));
|
||||
ensure!(scancode == u8::from(scancode))
|
||||
ensure!(
|
||||
scancode
|
||||
== Scancode::from_u8(flags.contains(KeyboardFlags::EXTENDED), packet_scancode)
|
||||
)
|
||||
} else {
|
||||
bail!("unexpected packet emitted");
|
||||
}
|
||||
}
|
||||
(Some(released_packet), Some(pressed_packet)) => {
|
||||
if let FastPathInputEvent::KeyboardEvent(flags, scancode) = released_packet {
|
||||
if let FastPathInputEvent::KeyboardEvent(flags, packet_scancode) = released_packet {
|
||||
ensure!(flags.contains(KeyboardFlags::RELEASE));
|
||||
ensure!(scancode == u8::from(scancode))
|
||||
ensure!(
|
||||
scancode
|
||||
== Scancode::from_u8(flags.contains(KeyboardFlags::EXTENDED), packet_scancode)
|
||||
)
|
||||
} else {
|
||||
bail!("unexpected packet emitted");
|
||||
}
|
||||
|
||||
if let FastPathInputEvent::KeyboardEvent(flags, scancode) = pressed_packet {
|
||||
if let FastPathInputEvent::KeyboardEvent(flags, packet_scancode) = pressed_packet {
|
||||
ensure!(!flags.contains(KeyboardFlags::RELEASE));
|
||||
ensure!(scancode == u8::from(scancode))
|
||||
ensure!(
|
||||
scancode
|
||||
== Scancode::from_u8(flags.contains(KeyboardFlags::EXTENDED), packet_scancode)
|
||||
)
|
||||
} else {
|
||||
bail!("unexpected packet emitted");
|
||||
}
|
||||
|
@ -129,9 +138,11 @@ fn smoke_keyboard() {
|
|||
let packet = packets.into_iter().next();
|
||||
|
||||
if let Some(packet) = packet {
|
||||
if let FastPathInputEvent::KeyboardEvent(flags, scancode) = packet {
|
||||
if let FastPathInputEvent::KeyboardEvent(flags, packet_scancode) = packet {
|
||||
ensure!(flags.contains(KeyboardFlags::RELEASE));
|
||||
ensure!(scancode == u8::from(scancode))
|
||||
ensure!(
|
||||
scancode == Scancode::from_u8(flags.contains(KeyboardFlags::EXTENDED), packet_scancode)
|
||||
)
|
||||
} else {
|
||||
bail!("unexpected packet emitted");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue