diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-03-06 06:14:01 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2019-03-06 07:00:30 +0100 |
commit | 4ea698233aa7f94e53a0bbf09e45506b216e32d4 (patch) | |
tree | c71847556c64de634e1d13330d2828b90173f0bb /tests/tdef/tdef_test.c | |
parent | 4f54c6c48d90ee94c3115a8ea6c60333e398e116 (diff) |
fix tdef_test.c: do call the function-to-test in all cases
Always call osmo_tdef_fsm_inst_state_chg(), also when no timeout is defined.
When there is no timeout defined for a state, tdef_test.c tries to be smart and
print different output. In that mess, I missed the fact that
osmo_tdef_fsm_inst_state_chg() isn't always called as it should. In the same
mess, the resulting state was never printed until the preceding patch, which
helped to hide this bug.
Change-Id: I1d953d99854422bff8eb32f051e9c6147bc836b6
Diffstat (limited to 'tests/tdef/tdef_test.c')
-rw-r--r-- | tests/tdef/tdef_test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/tdef/tdef_test.c b/tests/tdef/tdef_test.c index fe2accfa..12ca8020 100644 --- a/tests/tdef/tdef_test.c +++ b/tests/tdef/tdef_test.c @@ -323,12 +323,12 @@ static void print_fsm_state(struct osmo_fsm_inst *fi) #define test_tdef_fsm_state_chg(tdefs, NEXT_STATE) do { \ const struct osmo_tdef_state_timeout *st = osmo_tdef_get_state_timeout(NEXT_STATE, \ test_tdef_state_timeouts); \ + int rc = osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, test_tdef_state_timeouts, tdefs, 999); \ if (!st) { \ - printf(" --> %s (no timer configured for this state)\t", \ - osmo_fsm_state_name(&test_tdef_fsm, NEXT_STATE)); \ + printf(" --> %s (no timer configured for this state) rc=%d;\t", \ + osmo_fsm_state_name(&test_tdef_fsm, NEXT_STATE), rc); \ } else { \ struct osmo_tdef *t = osmo_tdef_get_entry(tdefs, st->T); \ - int rc = osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, test_tdef_state_timeouts, tdefs, 999); \ printf(" --> %s (configured as T%d%s %lu %s) rc=%d;\t", \ osmo_fsm_state_name(&test_tdef_fsm, NEXT_STATE), \ st->T, st->keep_timer ? "(keep_timer)" : "", \ |