diff options
Diffstat (limited to 'tests/fsm')
-rw-r--r-- | tests/fsm/fsm_test.c | 8 | ||||
-rw-r--r-- | tests/fsm/fsm_test.err | 16 |
2 files changed, 15 insertions, 9 deletions
diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c index 7a644213..c3ab91c2 100644 --- a/tests/fsm/fsm_test.c +++ b/tests/fsm/fsm_test.c @@ -94,7 +94,7 @@ static struct osmo_fsm_inst *foo(void) struct osmo_fsm_inst *fi; LOGP(DMAIN, LOGL_INFO, "Checking FSM allocation\n"); - fi = osmo_fsm_inst_alloc(&fsm, g_ctx, NULL, LOGL_DEBUG, NULL); + fi = osmo_fsm_inst_alloc(&fsm, g_ctx, NULL, LOGL_DEBUG, "my_id"); OSMO_ASSERT(fi); OSMO_ASSERT(fi->fsm == &fsm); OSMO_ASSERT(!strncmp(osmo_fsm_inst_name(fi), fsm.name, strlen(fsm.name))); @@ -143,10 +143,16 @@ int main(int argc, char **argv) log_add_target(stderr_target); log_set_print_filename(stderr_target, 0); + g_ctx = NULL; + OSMO_ASSERT(osmo_fsm_find_by_name(fsm.name) == NULL); osmo_fsm_register(&fsm); + OSMO_ASSERT(osmo_fsm_find_by_name(fsm.name) == &fsm); + OSMO_ASSERT(osmo_fsm_inst_find_by_name(&fsm, "my_id") == NULL); 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); while (1) { osmo_select_main(0); diff --git a/tests/fsm/fsm_test.err b/tests/fsm/fsm_test.err index c9021bbd..6f031be8 100644 --- a/tests/fsm/fsm_test.err +++ b/tests/fsm/fsm_test.err @@ -1,11 +1,11 @@ Checking FSM allocation -[0;mTest FSM{NULL}: Allocated -[0;mTest FSM{NULL}: Received Event 1 -[0;mTest FSM{NULL}: Event 1 not permitted -[0;mTest FSM{NULL}: Received Event 0 -[0;mTest FSM{NULL}: state_chg to ONE -[0;mTest FSM{ONE}: Received Event 1 -[0;mTest FSM{ONE}: state_chg to TWO -[0;mTest FSM{TWO}: Timeout of T2342 +[0;mTest FSM(my_id){NULL}: Allocated +[0;mTest FSM(my_id){NULL}: Received Event 1 +[0;mTest FSM(my_id){NULL}: Event 1 not permitted +[0;mTest FSM(my_id){NULL}: Received Event 0 +[0;mTest FSM(my_id){NULL}: state_chg to ONE +[0;mTest FSM(my_id){ONE}: Received Event 1 +[0;mTest FSM(my_id){ONE}: state_chg to TWO +[0;mTest FSM(my_id){TWO}: Timeout of T2342 [0;mTimer [0;m
\ No newline at end of file |