From 51d48245ad23faad5181140e8dd6e109470f7404 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 20 Oct 2020 12:16:48 -0700 Subject: [PATCH] Switch ConsumerControlReport and SystemControlReport to use ActiveKeycodes and ActiveKeycode respectively, to match Keyboard. --- testing/ConsumerControlReport.cpp | 2 +- testing/ConsumerControlReport.h | 2 +- testing/SystemControlReport.cpp | 2 +- testing/SystemControlReport.h | 2 +- tests/hid/hid-v1.2-consumer-keys/test/testcase.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testing/ConsumerControlReport.cpp b/testing/ConsumerControlReport.cpp index ad580fc5..70abb990 100644 --- a/testing/ConsumerControlReport.cpp +++ b/testing/ConsumerControlReport.cpp @@ -27,7 +27,7 @@ ConsumerControlReport::ConsumerControlReport(const void *data) { memcpy(&report_data_, &report_data, sizeof(report_data_)); } -std::vector ConsumerControlReport::Keys() const { +std::vector ConsumerControlReport::ActiveKeycodes() const { std::vector keys; if (report_data_.key1) keys.push_back(report_data_.key1); if (report_data_.key2) keys.push_back(report_data_.key2); diff --git a/testing/ConsumerControlReport.h b/testing/ConsumerControlReport.h index 022dbe7a..f0243739 100644 --- a/testing/ConsumerControlReport.h +++ b/testing/ConsumerControlReport.h @@ -33,7 +33,7 @@ class ConsumerControlReport { ConsumerControlReport(const void *data); - std::vector Keys() const; + std::vector ActiveKeycodes() const; private: ReportData report_data_; diff --git a/testing/SystemControlReport.cpp b/testing/SystemControlReport.cpp index 31f04991..9385ad79 100644 --- a/testing/SystemControlReport.cpp +++ b/testing/SystemControlReport.cpp @@ -30,7 +30,7 @@ SystemControlReport::SystemControlReport(const void* data) { } } -uint8_t SystemControlReport::Key() const { +uint8_t SystemControlReport::ActiveKeycode() const { return report_data_.key; } diff --git a/testing/SystemControlReport.h b/testing/SystemControlReport.h index c67e2db6..56a79a9e 100644 --- a/testing/SystemControlReport.h +++ b/testing/SystemControlReport.h @@ -33,7 +33,7 @@ class SystemControlReport : public std::vector { SystemControlReport(const void* data); - uint8_t Key() const; + uint8_t ActiveKeycode() const; private: ReportData report_data_; diff --git a/tests/hid/hid-v1.2-consumer-keys/test/testcase.cpp b/tests/hid/hid-v1.2-consumer-keys/test/testcase.cpp index 44389d0b..d7d2d2d5 100644 --- a/tests/hid/hid-v1.2-consumer-keys/test/testcase.cpp +++ b/tests/hid/hid-v1.2-consumer-keys/test/testcase.cpp @@ -32,7 +32,7 @@ TEST_F(KeyboardReports, HIDUsageTablev12KeycodesAdded) { ASSERT_EQ(state->HIDReports()->ConsumerControl().size(), 1); EXPECT_THAT( - state->HIDReports()->ConsumerControl(0).Keys(), + state->HIDReports()->ConsumerControl(0).ActiveKeycodes(), Contains(Consumer_VoiceCommand)); sim_.Release(1, 1); // VoiceCommand @@ -40,7 +40,7 @@ TEST_F(KeyboardReports, HIDUsageTablev12KeycodesAdded) { ASSERT_EQ(state->HIDReports()->ConsumerControl().size(), 1); EXPECT_THAT( - state->HIDReports()->ConsumerControl(0).Keys(), + state->HIDReports()->ConsumerControl(0).ActiveKeycodes(), IsEmpty()); state = RunCycle();