aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src
diff options
context:
space:
mode:
author5225225 <5225225@mailbox.org>2022-07-08 23:37:22 +0100
committerGitHub <noreply@github.com>2022-07-09 01:37:22 +0300
commit563c4151df42ecefa866a6a4c164bf1e49626b70 (patch)
tree8cd7867a4b93ddf114f3debb6aa508640ad048d6 /alacritty/src
parentebc6922eaae28173532235222f9790c8ab3fdaa7 (diff)
downloadr-alacritty-563c4151df42ecefa866a6a4c164bf1e49626b70.tar.gz
r-alacritty-563c4151df42ecefa866a6a4c164bf1e49626b70.tar.bz2
r-alacritty-563c4151df42ecefa866a6a4c164bf1e49626b70.zip
Use DeviceId/WindowId::dummy in tests
Diffstat (limited to 'alacritty/src')
-rw-r--r--alacritty/src/input.rs27
1 files changed, 14 insertions, 13 deletions
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index 0441ecb4..777b902c 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -978,7 +978,8 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
mod tests {
use super::*;
- use glutin::event::{Event as GlutinEvent, VirtualKeyCode, WindowEvent};
+ use glutin::event::{DeviceId, Event as GlutinEvent, VirtualKeyCode, WindowEvent};
+ use glutin::window::WindowId;
use alacritty_terminal::event::Event as TerminalEvent;
@@ -1190,10 +1191,10 @@ mod tests {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Left,
- device_id: unsafe { std::mem::transmute_copy(&0) },
+ device_id: unsafe { DeviceId::dummy() },
modifiers: ModifiersState::default(),
},
- window_id: unsafe { std::mem::transmute_copy(&0) },
+ window_id: unsafe { WindowId::dummy() },
},
end_state: ClickState::Click,
}
@@ -1206,10 +1207,10 @@ mod tests {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Right,
- device_id: unsafe { std::mem::transmute_copy(&0) },
+ device_id: unsafe { DeviceId::dummy() },
modifiers: ModifiersState::default(),
},
- window_id: unsafe { std::mem::transmute_copy(&0) },
+ window_id: unsafe { WindowId::dummy() },
},
end_state: ClickState::Click,
}
@@ -1222,10 +1223,10 @@ mod tests {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Middle,
- device_id: unsafe { std::mem::transmute_copy(&0) },
+ device_id: unsafe { DeviceId::dummy() },
modifiers: ModifiersState::default(),
},
- window_id: unsafe { std::mem::transmute_copy(&0) },
+ window_id: unsafe { WindowId::dummy() },
},
end_state: ClickState::Click,
}
@@ -1238,10 +1239,10 @@ mod tests {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Left,
- device_id: unsafe { std::mem::transmute_copy(&0) },
+ device_id: unsafe { DeviceId::dummy() },
modifiers: ModifiersState::default(),
},
- window_id: unsafe { std::mem::transmute_copy(&0) },
+ window_id: unsafe { WindowId::dummy() },
},
end_state: ClickState::DoubleClick,
}
@@ -1254,10 +1255,10 @@ mod tests {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Left,
- device_id: unsafe { std::mem::transmute_copy(&0) },
+ device_id: unsafe { DeviceId::dummy() },
modifiers: ModifiersState::default(),
},
- window_id: unsafe { std::mem::transmute_copy(&0) },
+ window_id: unsafe { WindowId::dummy() },
},
end_state: ClickState::TripleClick,
}
@@ -1270,10 +1271,10 @@ mod tests {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Right,
- device_id: unsafe { std::mem::transmute_copy(&0) },
+ device_id: unsafe { DeviceId::dummy() },
modifiers: ModifiersState::default(),
},
- window_id: unsafe { std::mem::transmute_copy(&0) },
+ window_id: unsafe { WindowId::dummy() },
},
end_state: ClickState::Click,
}