summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authornesovic2009-09-29 08:51:05 +0000
committernesovic2009-09-29 08:51:05 +0000
commitefdfef1d1f8f3bb631f15cb1adb5f7dd614080a5 (patch)
tree56be58a84e131a04f8a3ea1e8a96b60cc0cf52f7 /cesar
parentf6e9e4b82172473d4e420aa3d84ae978c6de909e (diff)
[EOC][cp_cco] Unitary test for cp_eoc_cco_fsm updated with MULTI_STA_MME event
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5803 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/cp/eoc/cco/action/test/utest/inc/scenario_defs.h5
-rw-r--r--cesar/cp/eoc/cco/action/test/utest/src/fsm_stub.c12
-rw-r--r--cesar/cp/eoc/cco/action/test/utest/src/test_fsm.c34
3 files changed, 49 insertions, 2 deletions
diff --git a/cesar/cp/eoc/cco/action/test/utest/inc/scenario_defs.h b/cesar/cp/eoc/cco/action/test/utest/inc/scenario_defs.h
index 008d5840fd..f877154868 100644
--- a/cesar/cp/eoc/cco/action/test/utest/inc/scenario_defs.h
+++ b/cesar/cp/eoc/cco/action/test/utest/inc/scenario_defs.h
@@ -78,7 +78,8 @@ scenario_action_process_urgent_cb (scenario_globals_t *globals,
cp_eoc_cco_action__cco_drv_mac_stop, \
cp_eoc_cco_action__bcco_no_beacons, \
cp_eoc_cco_action__bcco_drv_mac_stop, \
- cp_eoc_cco_action_send_central_beacon
+ cp_eoc_cco_action_send_central_beacon,\
+ cp_eoc_cco_action_event_dispatch
typedef struct
{
@@ -97,6 +98,8 @@ typedef scenario_empty_t
scenario_event_cp_eoc_cco_action__bcco_drv_mac_stop_t;
typedef scenario_empty_t
scenario_event_cp_eoc_cco_action_send_central_beacon_t;
+typedef scenario_empty_t
+scenario_event_cp_eoc_cco_action_event_dispatch_t;
#endif /* inc_scenario_defs_h */
diff --git a/cesar/cp/eoc/cco/action/test/utest/src/fsm_stub.c b/cesar/cp/eoc/cco/action/test/utest/src/fsm_stub.c
index 7805471cf3..012346176b 100644
--- a/cesar/cp/eoc/cco/action/test/utest/src/fsm_stub.c
+++ b/cesar/cp/eoc/cco/action/test/utest/src/fsm_stub.c
@@ -35,6 +35,9 @@ cp_eoc_cco_action__bcco_no_beacons (cp_t *ctx);
void
cp_eoc_cco_action_send_central_beacon (cp_t *ctx);
+void
+cp_eoc_cco_action_event_dispatch (cp_t *ctx);
+
/* Include generated tables. */
#include "cp_fsm_tables.h"
@@ -71,5 +74,12 @@ cp_eoc_cco_action__bcco_drv_mac_stop (cp_t *ctx)
void
cp_eoc_cco_action_send_central_beacon (cp_t *ctx)
{
- scenario_event (cp_eoc_cco_action_send_central_beacon);
+ scenario_event
+(cp_eoc_cco_action_send_central_beacon);
+}
+
+void
+cp_eoc_cco_action_event_dispatch (cp_t *ctx)
+{
+ scenario_event (cp_eoc_cco_action_event_dispatch);
}
diff --git a/cesar/cp/eoc/cco/action/test/utest/src/test_fsm.c b/cesar/cp/eoc/cco/action/test/utest/src/test_fsm.c
index 30991631d9..71e6f3b713 100644
--- a/cesar/cp/eoc/cco/action/test/utest/src/test_fsm.c
+++ b/cesar/cp/eoc/cco/action/test/utest/src/test_fsm.c
@@ -54,6 +54,40 @@ test_fsm_basic_test_case (test_t t)
cp_fsm_uninit (&cp);
} test_end;
+
+
+ test_begin (t, "CCO -> Multi_sta")
+ {
+ cp_fsm_init (&cp);
+ cp.sta_core_flag = false;
+ scenario_entry_t entries[] = {
+ /* POWER_ON */
+ SCENARIO_ACTION (post_and_process,
+ .type = CP_FSM_EVENT_TYPE_no_beacons),
+ SCENARIO_EVENT (cp_eoc_cco_action__power_on_no_beacons),
+ /* CCO*/
+ SCENARIO_ACTION (post_and_process,
+ .type = CP_FSM_EVENT_TYPE_MULTI_STA_MME),
+ SCENARIO_EVENT (cp_eoc_cco_action_event_dispatch),
+ /* CCO */
+ SCENARIO_ACTION (post_and_process,
+ .type = CP_FSM_EVENT_TYPE_DRV_MAC_STOP),
+ SCENARIO_EVENT (cp_eoc_cco_action__cco_drv_mac_stop),
+ /* STOPPING */
+ SCENARIO_END
+ };
+ scenario_globals_t globals = {
+ .cp = &cp,
+ };
+ scenario_run (t, entries, &globals);
+ test_fail_unless (cp.fsm.active_states[0] == CP_FSM_STATE_STOPPING);
+ cp_fsm_uninit (&cp);
+ } test_end;
+
+
+
+
+
test_begin (t, "BCCO")
{
cp_fsm_init (&cp);