inputflinger_tests: Put `FakeEventHub` in its own file
I would like to be able to put automated tests for the new `TouchpadEventMapper` in their own file, rather than InputReader_tests.cpp. To do this I'll need some of the test utilities in their own files, too. Aside from extracting the `FakeEventHub` definition into its own file and putting method bodies into a .cpp file, I've made a few other minor refactors: * Use an early return to reduce nesting in `markSupportedKeyCodes` * Use a ternary instead of an `if` in `getScanCodeState` * Remove some single-use `device` variables and replace their use with a call to `getDevice` * Reordered the methods in the .h to make the grouping a little more logical * Tried to follow "Include What You Use" in the new files Bug: 251196347 Test: atest inputflinger_tests Change-Id: I55fe8267976d7aba58e1e4067b041d92dfd5347d to fixup Change-Id: I59df4e03db7e30cf7d17425ed38fe7f639dec836
Loading
Please register or sign in to comment