diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2018-03-14 18:31:33 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-03-19 20:28:11 +0000 |
commit | 04a2a3231f8c300e27e0d8309acef081ed58d80f (patch) | |
tree | 27f8aa4e05c145b3c789026153626a3f15173e05 /tests | |
parent | d86055b431275cedb73bce32cb18dfc41dff0d15 (diff) |
fsm: Update the name as well if the id is updated and accept NULL
If the name stays the same the log messages will still log with the old
id. Since we can now change the id we need to update the name as well.
NULL as id was allowed before so we should allow that as well.
Change-Id: I6b01eb10b8a05fee3e4a5cdefdcf3ce9f79545b4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fsm/fsm_test.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c index f70b0b5c..d7b08aec 100644 --- a/tests/fsm/fsm_test.c +++ b/tests/fsm/fsm_test.c @@ -196,6 +196,10 @@ int main(int argc, char **argv) finst = foo(); OSMO_ASSERT(osmo_fsm_inst_find_by_id(&fsm, "my_id") == finst); OSMO_ASSERT(osmo_fsm_inst_find_by_name(&fsm, "Test_FSM(my_id)") == finst); + OSMO_ASSERT(osmo_fsm_inst_update_id(finst, "another_id") == 0); + OSMO_ASSERT(osmo_fsm_inst_find_by_id(&fsm, "another_id") == finst); + OSMO_ASSERT(osmo_fsm_inst_find_by_name(&fsm, "Test_FSM(another_id)") == finst); + OSMO_ASSERT(osmo_fsm_inst_update_id(finst, "my_id") == 0); while (1) { osmo_select_main(0); |