Skip to content
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

Merged
merged 1 commit into from
Aug 4, 2022
Merged

Add Unit Tests for InputEventKey #59193

merged 1 commit into from
Aug 4, 2022

Conversation

rocketman1243
Copy link

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.

Copy link
Member

@Geometror Geometror left a 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 */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* test_input_event_key.h */
/* test_input_event_key.h */

Copy link
Member

@akien-mga akien-mga left a 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.

@akien-mga akien-mga merged commit 20e4b90 into godotengine:master Aug 4, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants