diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-03-01 10:35:53 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-03-01 10:35:53 +0530 |
| commit | 96b074de6104161c62e09b2b1a725316dbf1c5f3 (patch) | |
| tree | 0ff68fd7fdf611365a20f718664818f27437e630 /test/button_test.c | |
| parent | 18268280dc6c0bd44035b53655ae43e9c88245bd (diff) | |
| download | daft-watch-96b074de6104161c62e09b2b1a725316dbf1c5f3.tar.gz daft-watch-96b074de6104161c62e09b2b1a725316dbf1c5f3.zip | |
Add tests for mode state
Diffstat (limited to 'test/button_test.c')
| -rw-r--r-- | test/button_test.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/button_test.c b/test/button_test.c index 3c48e43..bef557c 100644 --- a/test/button_test.c +++ b/test/button_test.c @@ -1,8 +1,17 @@ #include "button.h" #include "mode.h" +#include "stubbed/testutils.h" #include <assert.h> #include <avr/io.h> +void before_each() { + PINA = (1 << PA0); // Active on low + button_tick_count = 0; + button_inactive_for_ticks = 0; +} + +void after_each() {} + void test_button_press() { assert(check_button_state() == ButtonIdle); @@ -51,13 +60,6 @@ void test_button_inactive_after_press() { assert(check_button_state() == ButtonActive); } -void before_each() { - PINA = (1 << PA0); // Active on low - button_tick_count = 0; - button_inactive_for_ticks = 0; -} -#define TEST before_each(); - int main() { TEST test_button_press(); TEST test_button_long_press(); |
