aboutsummaryrefslogtreecommitdiff
path: root/quantum/debounce/tests/sym_eager_pr_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/debounce/tests/sym_eager_pr_tests.cpp')
-rw-r--r--quantum/debounce/tests/sym_eager_pr_tests.cpp57
1 files changed, 38 insertions, 19 deletions
diff --git a/quantum/debounce/tests/sym_eager_pr_tests.cpp b/quantum/debounce/tests/sym_eager_pr_tests.cpp
index 2c4bca127..e91dd9cb8 100644
--- a/quantum/debounce/tests/sym_eager_pr_tests.cpp
+++ b/quantum/debounce/tests/sym_eager_pr_tests.cpp
@@ -19,7 +19,8 @@
19#include "debounce_test_common.h" 19#include "debounce_test_common.h"
20 20
21TEST_F(DebounceTest, OneKeyShort1) { 21TEST_F(DebounceTest, OneKeyShort1) {
22 addEvents({ /* Time, Inputs, Outputs */ 22 addEvents({
23 /* Time, Inputs, Outputs */
23 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 24 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
24 {1, {{0, 1, UP}}, {}}, 25 {1, {{0, 1, UP}}, {}},
25 26
@@ -32,7 +33,8 @@ TEST_F(DebounceTest, OneKeyShort1) {
32} 33}
33 34
34TEST_F(DebounceTest, OneKeyShort2) { 35TEST_F(DebounceTest, OneKeyShort2) {
35 addEvents({ /* Time, Inputs, Outputs */ 36 addEvents({
37 /* Time, Inputs, Outputs */
36 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 38 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
37 {1, {{0, 1, UP}}, {}}, 39 {1, {{0, 1, UP}}, {}},
38 40
@@ -45,7 +47,8 @@ TEST_F(DebounceTest, OneKeyShort2) {
45} 47}
46 48
47TEST_F(DebounceTest, OneKeyShort3) { 49TEST_F(DebounceTest, OneKeyShort3) {
48 addEvents({ /* Time, Inputs, Outputs */ 50 addEvents({
51 /* Time, Inputs, Outputs */
49 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 52 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
50 {1, {{0, 1, UP}}, {}}, 53 {1, {{0, 1, UP}}, {}},
51 54
@@ -58,7 +61,8 @@ TEST_F(DebounceTest, OneKeyShort3) {
58} 61}
59 62
60TEST_F(DebounceTest, OneKeyShort4) { 63TEST_F(DebounceTest, OneKeyShort4) {
61 addEvents({ /* Time, Inputs, Outputs */ 64 addEvents({
65 /* Time, Inputs, Outputs */
62 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 66 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
63 {1, {{0, 1, UP}}, {}}, 67 {1, {{0, 1, UP}}, {}},
64 68
@@ -71,7 +75,8 @@ TEST_F(DebounceTest, OneKeyShort4) {
71} 75}
72 76
73TEST_F(DebounceTest, OneKeyShort5) { 77TEST_F(DebounceTest, OneKeyShort5) {
74 addEvents({ /* Time, Inputs, Outputs */ 78 addEvents({
79 /* Time, Inputs, Outputs */
75 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 80 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
76 {1, {{0, 1, UP}}, {}}, 81 {1, {{0, 1, UP}}, {}},
77 82
@@ -83,7 +88,8 @@ TEST_F(DebounceTest, OneKeyShort5) {
83} 88}
84 89
85TEST_F(DebounceTest, OneKeyShort6) { 90TEST_F(DebounceTest, OneKeyShort6) {
86 addEvents({ /* Time, Inputs, Outputs */ 91 addEvents({
92 /* Time, Inputs, Outputs */
87 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 93 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
88 {1, {{0, 1, UP}}, {}}, 94 {1, {{0, 1, UP}}, {}},
89 95
@@ -95,7 +101,8 @@ TEST_F(DebounceTest, OneKeyShort6) {
95} 101}
96 102
97TEST_F(DebounceTest, OneKeyBouncing1) { 103TEST_F(DebounceTest, OneKeyBouncing1) {
98 addEvents({ /* Time, Inputs, Outputs */ 104 addEvents({
105 /* Time, Inputs, Outputs */
99 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 106 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
100 {1, {{0, 1, UP}}, {}}, 107 {1, {{0, 1, UP}}, {}},
101 {2, {{0, 1, DOWN}}, {}}, 108 {2, {{0, 1, DOWN}}, {}},
@@ -110,7 +117,8 @@ TEST_F(DebounceTest, OneKeyBouncing1) {
110} 117}
111 118
112TEST_F(DebounceTest, OneKeyBouncing2) { 119TEST_F(DebounceTest, OneKeyBouncing2) {
113 addEvents({ /* Time, Inputs, Outputs */ 120 addEvents({
121 /* Time, Inputs, Outputs */
114 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 122 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
115 /* Change twice in the same time period */ 123 /* Change twice in the same time period */
116 {1, {{0, 1, UP}}, {}}, 124 {1, {{0, 1, UP}}, {}},
@@ -135,7 +143,8 @@ TEST_F(DebounceTest, OneKeyBouncing2) {
135} 143}
136 144
137TEST_F(DebounceTest, OneKeyLong) { 145TEST_F(DebounceTest, OneKeyLong) {
138 addEvents({ /* Time, Inputs, Outputs */ 146 addEvents({
147 /* Time, Inputs, Outputs */
139 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 148 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
140 149
141 {25, {{0, 1, UP}}, {{0, 1, UP}}}, 150 {25, {{0, 1, UP}}, {{0, 1, UP}}},
@@ -146,7 +155,8 @@ TEST_F(DebounceTest, OneKeyLong) {
146} 155}
147 156
148TEST_F(DebounceTest, TwoRowsShort) { 157TEST_F(DebounceTest, TwoRowsShort) {
149 addEvents({ /* Time, Inputs, Outputs */ 158 addEvents({
159 /* Time, Inputs, Outputs */
150 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 160 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
151 {1, {{0, 1, UP}}, {}}, 161 {1, {{0, 1, UP}}, {}},
152 {2, {{2, 0, DOWN}}, {{2, 0, DOWN}}}, 162 {2, {{2, 0, DOWN}}, {{2, 0, DOWN}}},
@@ -167,7 +177,8 @@ TEST_F(DebounceTest, TwoRowsShort) {
167} 177}
168 178
169TEST_F(DebounceTest, TwoKeysOverlap) { 179TEST_F(DebounceTest, TwoKeysOverlap) {
170 addEvents({ /* Time, Inputs, Outputs */ 180 addEvents({
181 /* Time, Inputs, Outputs */
171 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 182 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
172 {1, {{0, 1, UP}}, {}}, 183 {1, {{0, 1, UP}}, {}},
173 /* Press a second key during the first debounce */ 184 /* Press a second key during the first debounce */
@@ -190,7 +201,8 @@ TEST_F(DebounceTest, TwoKeysOverlap) {
190} 201}
191 202
192TEST_F(DebounceTest, TwoKeysSimultaneous1) { 203TEST_F(DebounceTest, TwoKeysSimultaneous1) {
193 addEvents({ /* Time, Inputs, Outputs */ 204 addEvents({
205 /* Time, Inputs, Outputs */
194 {0, {{0, 1, DOWN}, {0, 2, DOWN}}, {{0, 1, DOWN}, {0, 2, DOWN}}}, 206 {0, {{0, 1, DOWN}, {0, 2, DOWN}}, {{0, 1, DOWN}, {0, 2, DOWN}}},
195 {20, {{0, 1, UP}}, {{0, 1, UP}}}, 207 {20, {{0, 1, UP}}, {{0, 1, UP}}},
196 {21, {{0, 2, UP}}, {}}, 208 {21, {{0, 2, UP}}, {}},
@@ -202,7 +214,8 @@ TEST_F(DebounceTest, TwoKeysSimultaneous1) {
202} 214}
203 215
204TEST_F(DebounceTest, TwoKeysSimultaneous2) { 216TEST_F(DebounceTest, TwoKeysSimultaneous2) {
205 addEvents({ /* Time, Inputs, Outputs */ 217 addEvents({
218 /* Time, Inputs, Outputs */
206 {0, {{0, 1, DOWN}, {0, 2, DOWN}}, {{0, 1, DOWN}, {0, 2, DOWN}}}, 219 {0, {{0, 1, DOWN}, {0, 2, DOWN}}, {{0, 1, DOWN}, {0, 2, DOWN}}},
207 {20, {{0, 1, UP}, {0, 2, UP}}, {{0, 1, UP}, {0, 2, UP}}}, 220 {20, {{0, 1, UP}, {0, 2, UP}}, {{0, 1, UP}, {0, 2, UP}}},
208 }); 221 });
@@ -210,7 +223,8 @@ TEST_F(DebounceTest, TwoKeysSimultaneous2) {
210} 223}
211 224
212TEST_F(DebounceTest, OneKeyDelayedScan1) { 225TEST_F(DebounceTest, OneKeyDelayedScan1) {
213 addEvents({ /* Time, Inputs, Outputs */ 226 addEvents({
227 /* Time, Inputs, Outputs */
214 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 228 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
215 229
216 /* Processing is very late but the change will now be accepted */ 230 /* Processing is very late but the change will now be accepted */
@@ -221,7 +235,8 @@ TEST_F(DebounceTest, OneKeyDelayedScan1) {
221} 235}
222 236
223TEST_F(DebounceTest, OneKeyDelayedScan2) { 237TEST_F(DebounceTest, OneKeyDelayedScan2) {
224 addEvents({ /* Time, Inputs, Outputs */ 238 addEvents({
239 /* Time, Inputs, Outputs */
225 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 240 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
226 241
227 /* Processing is very late but the change will now be accepted even with a 1 scan delay */ 242 /* Processing is very late but the change will now be accepted even with a 1 scan delay */
@@ -233,7 +248,8 @@ TEST_F(DebounceTest, OneKeyDelayedScan2) {
233} 248}
234 249
235TEST_F(DebounceTest, OneKeyDelayedScan3) { 250TEST_F(DebounceTest, OneKeyDelayedScan3) {
236 addEvents({ /* Time, Inputs, Outputs */ 251 addEvents({
252 /* Time, Inputs, Outputs */
237 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 253 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
238 254
239 /* Processing is very late but the change will now be accepted even with a 1ms delay */ 255 /* Processing is very late but the change will now be accepted even with a 1ms delay */
@@ -245,7 +261,8 @@ TEST_F(DebounceTest, OneKeyDelayedScan3) {
245} 261}
246 262
247TEST_F(DebounceTest, OneKeyDelayedScan4) { 263TEST_F(DebounceTest, OneKeyDelayedScan4) {
248 addEvents({ /* Time, Inputs, Outputs */ 264 addEvents({
265 /* Time, Inputs, Outputs */
249 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 266 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
250 267
251 /* Processing is a bit late but the change will now be accepted */ 268 /* Processing is a bit late but the change will now be accepted */
@@ -256,7 +273,8 @@ TEST_F(DebounceTest, OneKeyDelayedScan4) {
256} 273}
257 274
258TEST_F(DebounceTest, OneKeyDelayedScan5) { 275TEST_F(DebounceTest, OneKeyDelayedScan5) {
259 addEvents({ /* Time, Inputs, Outputs */ 276 addEvents({
277 /* Time, Inputs, Outputs */
260 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 278 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
261 279
262 /* Processing is very late but the change will now be accepted even with a 1 scan delay */ 280 /* Processing is very late but the change will now be accepted even with a 1 scan delay */
@@ -268,7 +286,8 @@ TEST_F(DebounceTest, OneKeyDelayedScan5) {
268} 286}
269 287
270TEST_F(DebounceTest, OneKeyDelayedScan6) { 288TEST_F(DebounceTest, OneKeyDelayedScan6) {
271 addEvents({ /* Time, Inputs, Outputs */ 289 addEvents({
290 /* Time, Inputs, Outputs */
272 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}}, 291 {0, {{0, 1, DOWN}}, {{0, 1, DOWN}}},
273 292
274 /* Processing is very late but the change will now be accepted even with a 1ms delay */ 293 /* Processing is very late but the change will now be accepted even with a 1ms delay */