diff options
author | Joel Challis <git@zvecr.com> | 2021-11-01 19:18:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-01 19:18:33 +0000 |
commit | 92385e30cdad61ddfc0461b1ce1340bcb494a68a (patch) | |
tree | d472f93ed9f4e42e4972630d8178a387b91a51bc /quantum/debounce/tests/debounce_test_common.h | |
parent | ee371c1295f00c119dd5a1bb2f3d4acedff832a7 (diff) | |
download | qmk_firmware-92385e30cdad61ddfc0461b1ce1340bcb494a68a.tar.gz qmk_firmware-92385e30cdad61ddfc0461b1ce1340bcb494a68a.zip |
Manually format develop (#15003)
Diffstat (limited to 'quantum/debounce/tests/debounce_test_common.h')
-rw-r--r-- | quantum/debounce/tests/debounce_test_common.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/quantum/debounce/tests/debounce_test_common.h b/quantum/debounce/tests/debounce_test_common.h index d87e31059..b7becb378 100644 --- a/quantum/debounce/tests/debounce_test_common.h +++ b/quantum/debounce/tests/debounce_test_common.h | |||
@@ -31,36 +31,34 @@ enum Direction { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | class MatrixTestEvent { | 33 | class MatrixTestEvent { |
34 | public: | 34 | public: |
35 | MatrixTestEvent(int row, int col, Direction direction); | 35 | MatrixTestEvent(int row, int col, Direction direction); |
36 | 36 | ||
37 | const int row_; | 37 | const int row_; |
38 | const int col_; | 38 | const int col_; |
39 | const Direction direction_; | 39 | const Direction direction_; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | class DebounceTestEvent { | 42 | class DebounceTestEvent { |
43 | public: | 43 | public: |
44 | // 0, {{0, 1, DOWN}}, {{0, 1, DOWN}}) | 44 | // 0, {{0, 1, DOWN}}, {{0, 1, DOWN}}) |
45 | DebounceTestEvent(fast_timer_t time, | 45 | DebounceTestEvent(fast_timer_t time, std::initializer_list<MatrixTestEvent> inputs, std::initializer_list<MatrixTestEvent> outputs); |
46 | std::initializer_list<MatrixTestEvent> inputs, | ||
47 | std::initializer_list<MatrixTestEvent> outputs); | ||
48 | 46 | ||
49 | const fast_timer_t time_; | 47 | const fast_timer_t time_; |
50 | const std::list<MatrixTestEvent> inputs_; | 48 | const std::list<MatrixTestEvent> inputs_; |
51 | const std::list<MatrixTestEvent> outputs_; | 49 | const std::list<MatrixTestEvent> outputs_; |
52 | }; | 50 | }; |
53 | 51 | ||
54 | class DebounceTest : public ::testing::Test { | 52 | class DebounceTest : public ::testing::Test { |
55 | protected: | 53 | protected: |
56 | void addEvents(std::initializer_list<DebounceTestEvent> events); | 54 | void addEvents(std::initializer_list<DebounceTestEvent> events); |
57 | void runEvents(); | 55 | void runEvents(); |
58 | 56 | ||
59 | fast_timer_t time_offset_ = 7777; | 57 | fast_timer_t time_offset_ = 7777; |
60 | bool time_jumps_ = false; | 58 | bool time_jumps_ = false; |
61 | 59 | ||
62 | private: | 60 | private: |
63 | static bool directionValue(Direction direction); | 61 | static bool directionValue(Direction direction); |
64 | static std::string directionLabel(Direction direction); | 62 | static std::string directionLabel(Direction direction); |
65 | 63 | ||
66 | void runEventsInternal(); | 64 | void runEventsInternal(); |
@@ -78,6 +76,6 @@ private: | |||
78 | matrix_row_t cooked_matrix_[MATRIX_ROWS]; | 76 | matrix_row_t cooked_matrix_[MATRIX_ROWS]; |
79 | matrix_row_t output_matrix_[MATRIX_ROWS]; | 77 | matrix_row_t output_matrix_[MATRIX_ROWS]; |
80 | 78 | ||
81 | int extra_iterations_; | 79 | int extra_iterations_; |
82 | bool auto_advance_time_; | 80 | bool auto_advance_time_; |
83 | }; | 81 | }; |