blob: c4ee46f9d76a7430e5ebad818c9b4455d2fd8391 [file] [log] [blame]
Harald Welte136e7372016-05-29 10:53:17 +09001Checking FSM allocation
Harald Welte31c0fef2017-04-16 17:26:30 +02002Test_FSM(my_id){NULL}: Allocated
Stefan Sperling888dc7d2018-02-26 19:17:02 +01003Test_FSM(my_id){NULL}: Received Event EV_B
4Test_FSM(my_id){NULL}: Event EV_B not permitted
5Test_FSM(my_id){NULL}: Received Event EV_A
Harald Welte31c0fef2017-04-16 17:26:30 +02006Test_FSM(my_id){NULL}: state_chg to ONE
Stefan Sperling888dc7d2018-02-26 19:17:02 +01007Test_FSM(my_id){ONE}: Received Event EV_B
Harald Welte31c0fef2017-04-16 17:26:30 +02008Test_FSM(my_id){ONE}: state_chg to TWO
9Test_FSM(my_id){TWO}: Timeout of T2342
Harald Welte136e7372016-05-29 10:53:17 +090010Timer
Neels Hofmeyrd8f175c2018-04-09 00:42:22 +020011Test_FSM(my_id){TWO}: Deallocated
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020012
13--- test_id_api()
14Test_FSM{NULL}: Allocated
15 osmo_fsm_inst_name() == "Test_FSM"
Neels Hofmeyr71f76a12018-03-31 16:30:25 +020016 osmo_fsm_inst_find_by_name("Test_FSM") == fi
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020017osmo_fsm_inst_update_id("my_id")
18 rc == 0, ok
19 osmo_fsm_inst_name() == "Test_FSM(my_id)"
20 osmo_fsm_inst_find_by_name("Test_FSM(my_id)") == fi
21 osmo_fsm_inst_find_by_id("my_id") == fi
22osmo_fsm_inst_update_id("another_id")
23 rc == 0, ok
24 osmo_fsm_inst_name() == "Test_FSM(another_id)"
25 osmo_fsm_inst_find_by_name("Test_FSM(another_id)") == fi
26 osmo_fsm_inst_find_by_id("another_id") == fi
27osmo_fsm_inst_update_id(NULL)
28 rc == 0, ok
29 osmo_fsm_inst_name() == "Test_FSM"
30 osmo_fsm_inst_find_by_name("Test_FSM") == fi
31osmo_fsm_inst_update_id(NULL)
32 rc == 0, ok
33 osmo_fsm_inst_name() == "Test_FSM"
34 osmo_fsm_inst_find_by_name("Test_FSM") == fi
35osmo_fsm_inst_update_id("arbitrary_id")
36 rc == 0, ok
37 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
38 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
39 osmo_fsm_inst_find_by_id("arbitrary_id") == fi
40osmo_fsm_inst_update_id("")
41Attempting to allocate FSM instance of type 'Test_FSM' with illegal identifier ''
42 rc == -22, ok
43 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
44 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
45osmo_fsm_inst_update_id("invalid.id")
46Attempting to allocate FSM instance of type 'Test_FSM' with illegal identifier 'invalid.id'
47 rc == -22, ok
48 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
49 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
50
51--- test_id_api() done
52
53Test_FSM(arbitrary_id){NULL}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
54Test_FSM(arbitrary_id){NULL}: Freeing instance
55Test_FSM(arbitrary_id){NULL}: Deallocated
Harald Welte136e7372016-05-29 10:53:17 +090056