tests.c: improve debounce tests robustness