Format code according to conventions (#16322)
This commit is contained in:
parent
afcdd7079c
commit
63646e8906
345 changed files with 4916 additions and 3229 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue