aboutsummaryrefslogtreecommitdiff
path: root/tests/test_common/keyboard_report_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_common/keyboard_report_util.cpp')
-rw-r--r--tests/test_common/keyboard_report_util.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp
index f73cf239e..e148c76be 100644
--- a/tests/test_common/keyboard_report_util.cpp
+++ b/tests/test_common/keyboard_report_util.cpp
@@ -44,16 +44,21 @@ bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs) {
44 return lhs.mods == rhs.mods && lhskeys == rhskeys; 44 return lhs.mods == rhs.mods && lhskeys == rhskeys;
45} 45}
46 46
47std::ostream& operator<<(std::ostream& stream, const report_keyboard_t& value) { 47std::ostream& operator<<(std::ostream& stream, const report_keyboard_t& report) {
48 stream << "Keyboard report:" << std::endl; 48 auto keys = get_keys(report);
49 stream << "Mods: " << (uint32_t)value.mods << std::endl; 49
50 stream << "Keys: ";
51 // TODO: This should probably print friendly names for the keys 50 // TODO: This should probably print friendly names for the keys
52 for (uint32_t k : get_keys(value)) { 51 stream << "Keyboard Report: Mods (" << (uint32_t)report.mods << ") Keys (";
53 stream << k << " "; 52
53 for (auto key = keys.cbegin(); key != keys.cend();) {
54 stream << +(*key);
55 key++;
56 if (key != keys.cend()) {
57 stream << ",";
58 }
54 } 59 }
55 stream << std::endl; 60
56 return stream; 61 return stream << ")" << std::endl;
57} 62}
58 63
59KeyboardReportMatcher::KeyboardReportMatcher(const std::vector<uint8_t>& keys) { 64KeyboardReportMatcher::KeyboardReportMatcher(const std::vector<uint8_t>& keys) {