feat: expand editor scripting asset and viewport flow
This commit is contained in:
@@ -285,6 +285,47 @@ TEST(InputManager, GetButtonUp) {
|
||||
mgr.Shutdown();
|
||||
}
|
||||
|
||||
TEST(InputManager, AnyKeyIncludesKeyboardAndMouseButtons) {
|
||||
InputManager& mgr = InputManager::Get();
|
||||
mgr.Initialize(nullptr);
|
||||
|
||||
EXPECT_FALSE(mgr.IsAnyKeyDown());
|
||||
|
||||
mgr.ProcessKeyDown(KeyCode::A, false, false, false, false, false);
|
||||
EXPECT_TRUE(mgr.IsAnyKeyDown());
|
||||
|
||||
mgr.ProcessKeyUp(KeyCode::A, false, false, false, false);
|
||||
EXPECT_FALSE(mgr.IsAnyKeyDown());
|
||||
|
||||
mgr.ProcessMouseButton(MouseButton::Left, true, 100, 200);
|
||||
EXPECT_TRUE(mgr.IsAnyKeyDown());
|
||||
|
||||
mgr.ProcessMouseButton(MouseButton::Left, false, 100, 200);
|
||||
EXPECT_FALSE(mgr.IsAnyKeyDown());
|
||||
|
||||
mgr.Shutdown();
|
||||
}
|
||||
|
||||
TEST(InputManager, AnyKeyPressedIsFrameScoped) {
|
||||
InputManager& mgr = InputManager::Get();
|
||||
mgr.Initialize(nullptr);
|
||||
|
||||
EXPECT_FALSE(mgr.IsAnyKeyPressed());
|
||||
|
||||
mgr.ProcessMouseButton(MouseButton::Left, true, 100, 200);
|
||||
EXPECT_TRUE(mgr.IsAnyKeyPressed());
|
||||
|
||||
mgr.Update(0.016f);
|
||||
EXPECT_FALSE(mgr.IsAnyKeyPressed());
|
||||
EXPECT_TRUE(mgr.IsAnyKeyDown());
|
||||
|
||||
mgr.ProcessMouseButton(MouseButton::Left, false, 100, 200);
|
||||
EXPECT_FALSE(mgr.IsAnyKeyPressed());
|
||||
EXPECT_FALSE(mgr.IsAnyKeyDown());
|
||||
|
||||
mgr.Shutdown();
|
||||
}
|
||||
|
||||
TEST(InputManager, RegisterAxis) {
|
||||
InputManager& mgr = InputManager::Get();
|
||||
mgr.Initialize(nullptr);
|
||||
@@ -320,7 +361,7 @@ TEST(InputManager, GetAxisRaw) {
|
||||
EXPECT_EQ(mgr.GetAxisRaw("RawTest"), 1.0f);
|
||||
|
||||
mgr.Update(0.016f);
|
||||
EXPECT_EQ(mgr.GetAxisRaw("RawTest"), 0.0f);
|
||||
EXPECT_EQ(mgr.GetAxisRaw("RawTest"), 1.0f);
|
||||
|
||||
mgr.Shutdown();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user