From 36f820be7e80bc8f1f5489373708356cf142c269 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 18 Jun 2017 23:49:38 +0300 Subject: Add a test fixture It only initializes QMK once, and clears the matrix after each test. --- tests/test_common/matrix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/test_common/matrix.c') diff --git a/tests/test_common/matrix.c b/tests/test_common/matrix.c index 5ab5bac6c..0d9fa68b0 100644 --- a/tests/test_common/matrix.c +++ b/tests/test_common/matrix.c @@ -22,7 +22,7 @@ static matrix_row_t matrix[MATRIX_ROWS] = {}; void matrix_init(void) { - memset(matrix, 0, sizeof(matrix)); + clear_all_keys(); matrix_init_quantum(); } @@ -54,3 +54,7 @@ void press_key(uint8_t col, uint8_t row) { void release_key(uint8_t col, uint8_t row) { matrix[row] &= ~(1 << col); } + +void clear_all_keys(void) { + memset(matrix, 0, sizeof(matrix)); +} -- cgit v1.2.3