diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-05-23 10:20:30 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-05-23 10:20:30 +0200 |
commit | e391c08b9e276dc80a9626ad61126c96854d3059 (patch) | |
tree | 030305bddbd175cf9c150cdaa5435ba581a9152a | |
parent | 000820413714cf619810292668fa12c649955750 (diff) |
dtmf: Extend the test from the previous commithfreyther/dtmf/single-tones
-rw-r--r-- | tests/dtmf/dtmf_test.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/dtmf/dtmf_test.c b/tests/dtmf/dtmf_test.c index 2759920..d92011c 100644 --- a/tests/dtmf/dtmf_test.c +++ b/tests/dtmf/dtmf_test.c @@ -119,19 +119,29 @@ static void test_queue_single_pop(void) dtmf_state_add(&state, '0'); dtmf_state_add(&state, '1'); dtmf_state_add(&state, '2'); + ASSERT(dtmf_tones_queued(&state), 3); ASSERT(dtmf_state_pop_tone(&state), '0'); + ASSERT(dtmf_tones_queued(&state), 2); ASSERT(dtmf_state_pop_tone(&state), '1'); + ASSERT(dtmf_tones_queued(&state), 1); ASSERT(dtmf_state_pop_tone(&state), '2'); + ASSERT(dtmf_tones_queued(&state), 0); ASSERT(dtmf_state_pop_tone(&state), CHAR_MAX); dtmf_state_add(&state, '3'); dtmf_state_add(&state, '4'); dtmf_state_add(&state, '5'); + ASSERT(dtmf_tones_queued(&state), 3); ASSERT(dtmf_state_pop_tone(&state), '3'); + ASSERT(dtmf_tones_queued(&state), 2); ASSERT(dtmf_state_pop_tone(&state), '4'); + ASSERT(dtmf_tones_queued(&state), 1); dtmf_state_add(&state, '6'); + ASSERT(dtmf_tones_queued(&state), 2); ASSERT(dtmf_state_pop_tone(&state), '5'); + ASSERT(dtmf_tones_queued(&state), 1); ASSERT(dtmf_state_pop_tone(&state), '6'); + ASSERT(dtmf_tones_queued(&state), 0); ASSERT(dtmf_state_pop_tone(&state), CHAR_MAX); } |