-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Unit Tests for InputEventKey #59193
Add Unit Tests for InputEventKey #59193
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good :)
Just a few style nitpicks: For some variable names you use camelCase, but snake_case should be used instead. (e.g. noneKey
, refKey
, noneRef
,...)
@@ -0,0 +1,296 @@ | |||
/*************************************************************************/ | |||
/* test_input_event_key.h */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* test_input_event_key.h */ | |
/* test_input_event_key.h */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force pushed a rebase to solve style issues, should be good to go now.
I didn't do a thorough review of the actual tests, I think we might want to check a bit more in depth and see if we don't want to further improve the logic of InputEventKey.
For example the fact that physical/non-physical state is based solely on the value of keycode
being NONE
or not, and the text representation of this event.
Thanks! |
This PR adds unit tests for the InputEventKey class.
I tried to test both happy paths and failure paths, such that each part of the if statement gets executed.
If you have any comments or remarks, please let me know!
This PR is part of #43440.