summaryrefslogtreecommitdiffstats
path: root/tests/test_common
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_common')
-rw-r--r--tests/test_common/keyboard_report_util.cpp14
-rw-r--r--tests/test_common/matrix.c16
-rw-r--r--tests/test_common/test_driver.cpp20
-rw-r--r--tests/test_common/test_fixture.cpp4
-rw-r--r--tests/test_common/test_logger.cpp8
5 files changed, 46 insertions, 16 deletions
diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp
index e148c76beb..7908e64f7f 100644
--- a/tests/test_common/keyboard_report_util.cpp
+++ b/tests/test_common/keyboard_report_util.cpp
@@ -36,7 +36,7 @@ std::vector<uint8_t> get_keys(const report_keyboard_t& report) {
std::sort(result.begin(), result.end());
return result;
}
-} // namespace
+} // namespace
bool operator==(const report_keyboard_t& lhs, const report_keyboard_t& rhs) {
auto lhskeys = get_keys(lhs);
@@ -72,8 +72,14 @@ KeyboardReportMatcher::KeyboardReportMatcher(const std::vector<uint8_t>& keys) {
}
}
-bool KeyboardReportMatcher::MatchAndExplain(report_keyboard_t& report, MatchResultListener* listener) const { return m_report == report; }
+bool KeyboardReportMatcher::MatchAndExplain(report_keyboard_t& report, MatchResultListener* listener) const {
+ return m_report == report;
+}
-void KeyboardReportMatcher::DescribeTo(::std::ostream* os) const { *os << "is equal to " << m_report; }
+void KeyboardReportMatcher::DescribeTo(::std::ostream* os) const {
+ *os << "is equal to " << m_report;
+}
-void KeyboardReportMatcher::DescribeNegationTo(::std::ostream* os) const { *os << "is not equal to " << m_report; }
+void KeyboardReportMatcher::DescribeNegationTo(::std::ostream* os) const {
+ *os << "is not equal to " << m_report;
+}
diff --git a/tests/test_common/matrix.c b/tests/test_common/matrix.c
index 9a92a801c7..7b24d560e3 100644
--- a/tests/test_common/matrix.c
+++ b/tests/test_common/matrix.c
@@ -30,7 +30,9 @@ uint8_t matrix_scan(void) {
return 1;
}
-matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }
+matrix_row_t matrix_get_row(uint8_t row) {
+ return matrix[row];
+}
void matrix_print(void) {}
@@ -38,10 +40,16 @@ void matrix_init_kb(void) {}
void matrix_scan_kb(void) {}
-void press_key(uint8_t col, uint8_t row) { matrix[row] |= 1 << col; }
+void press_key(uint8_t col, uint8_t row) {
+ matrix[row] |= 1 << col;
+}
-void release_key(uint8_t col, uint8_t row) { matrix[row] &= ~(1 << col); }
+void release_key(uint8_t col, uint8_t row) {
+ matrix[row] &= ~(1 << col);
+}
-void clear_all_keys(void) { memset(matrix, 0, sizeof(matrix)); }
+void clear_all_keys(void) {
+ memset(matrix, 0, sizeof(matrix));
+}
void led_set(uint8_t usb_led) {}
diff --git a/tests/test_common/test_driver.cpp b/tests/test_common/test_driver.cpp
index 2fa2b6a2e7..68f1dfd17d 100644
--- a/tests/test_common/test_driver.cpp
+++ b/tests/test_common/test_driver.cpp
@@ -23,17 +23,27 @@ TestDriver::TestDriver() : m_driver{&TestDriver::keyboard_leds, &TestDriver::sen
m_this = this;
}
-TestDriver::~TestDriver() { m_this = nullptr; }
+TestDriver::~TestDriver() {
+ m_this = nullptr;
+}
-uint8_t TestDriver::keyboard_leds(void) { return m_this->m_leds; }
+uint8_t TestDriver::keyboard_leds(void) {
+ return m_this->m_leds;
+}
void TestDriver::send_keyboard(report_keyboard_t* report) {
test_logger.trace() << *report;
m_this->send_keyboard_mock(*report);
}
-void TestDriver::send_mouse(report_mouse_t* report) { m_this->send_mouse_mock(*report); }
+void TestDriver::send_mouse(report_mouse_t* report) {
+ m_this->send_mouse_mock(*report);
+}
-void TestDriver::send_system(uint16_t data) { m_this->send_system_mock(data); }
+void TestDriver::send_system(uint16_t data) {
+ m_this->send_system_mock(data);
+}
-void TestDriver::send_consumer(uint16_t data) { m_this->send_consumer(data); }
+void TestDriver::send_consumer(uint16_t data) {
+ m_this->send_consumer(data);
+}
diff --git a/tests/test_common/test_fixture.cpp b/tests/test_common/test_fixture.cpp
index 91bf3e779e..c98a679554 100644
--- a/tests/test_common/test_fixture.cpp
+++ b/tests/test_common/test_fixture.cpp
@@ -55,7 +55,9 @@ void TestFixture::SetUpTestCase() {
void TestFixture::TearDownTestCase() {}
-TestFixture::TestFixture() { m_this = this; }
+TestFixture::TestFixture() {
+ m_this = this;
+}
TestFixture::~TestFixture() {
test_logger.info() << "TestFixture clean-up start." << std::endl;
diff --git a/tests/test_common/test_logger.cpp b/tests/test_common/test_logger.cpp
index 959fdde5ec..efc7719d13 100644
--- a/tests/test_common/test_logger.cpp
+++ b/tests/test_common/test_logger.cpp
@@ -34,6 +34,10 @@ TestLogger& TestLogger::error() {
return *this;
}
-void TestLogger::reset() { this->m_log.str(""); };
+void TestLogger::reset() {
+ this->m_log.str("");
+};
-void TestLogger::print_log() { std::cerr << this->m_log.str(); }
+void TestLogger::print_log() {
+ std::cerr << this->m_log.str();
+}