X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tests%2Ftest_common%2Fkeyboard_report_util.cpp;h=bf728b9a2a801bba3c4efcfa84a09ea6e55be4b5;hb=aee67854769feee7e94edd90686178d89946a7ee;hp=34e53cd4cdf597be6d2c9a1dd3c24d569d34ea27;hpb=e85b1857968d4c0378b9778650c30b9d2bca3ea9;p=qmk_firmware.git
diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp
index 34e53cd4c..bf728b9a2 100644
--- a/tests/test_common/keyboard_report_util.cpp
+++ b/tests/test_common/keyboard_report_util.cpp
@@ -14,7 +14,7 @@
* along with this program. If not, see .
*/
- #include "keyboard_report_util.h"
+ #include "keyboard_report_util.hpp"
#include
#include
using namespace testing;
@@ -47,16 +47,25 @@ bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs) {
std::ostream& operator<<(std::ostream& stream, const report_keyboard_t& value) {
stream << "Keyboard report:" << std::endl;
+ stream << "Mods: " << (uint32_t)value.mods << std::endl;
+ stream << "Keys: ";
+ // TODO: This should probably print friendly names for the keys
for (uint32_t k: get_keys(value)) {
- stream << k << std::endl;
+ stream << k << " ";
}
+ stream << std::endl;
return stream;
}
KeyboardReportMatcher::KeyboardReportMatcher(const std::vector& keys) {
memset(m_report.raw, 0, sizeof(m_report.raw));
for (auto k: keys) {
- add_key_to_report(&m_report, k);
+ if (IS_MOD(k)) {
+ m_report.mods |= MOD_BIT(k);
+ }
+ else {
+ add_key_to_report(&m_report, k);
+ }
}
}