summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschodet2008-03-06 17:17:54 +0000
committerschodet2008-03-06 17:17:54 +0000
commit24c3255f0eb80b9d2e900149b9b46869c4e1c4f1 (patch)
tree776aeba65f55e09da158829c790c9dd09e0e35f8
parent67f3a3bd81b8e586443e0254ad427ad1f8d2bebf (diff)
* mac/pbproc/test/pbproc:
- better PBProc coverage: large number of received PB. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1579 017c9cb6-072f-447c-8318-d5b54f68fe89
-rw-r--r--mac/pbproc/test/pbproc/inc/scenario.h8
-rw-r--r--mac/pbproc/test/pbproc/src/rx_data.c17
-rw-r--r--mac/pbproc/test/pbproc/src/scenario.c15
3 files changed, 35 insertions, 5 deletions
diff --git a/mac/pbproc/test/pbproc/inc/scenario.h b/mac/pbproc/test/pbproc/inc/scenario.h
index 830aa1ac43..bf2c236b04 100644
--- a/mac/pbproc/test/pbproc/inc/scenario.h
+++ b/mac/pbproc/test/pbproc/inc/scenario.h
@@ -33,6 +33,8 @@ enum scenario_event_id_t
{
/** Event identifier for end of list. */
SCENARIO_NULL_ID,
+ /** Event identifier for no operation. */
+ SCENARIO_NOP_ID,
/** Event identifier for action. */
SCENARIO_ACTION_ID,
#define SCENARIO_DEFS_EVENTS_ID(event) PASTE (SCENARIO_EVENT_, event)
@@ -100,6 +102,8 @@ extern scenario_t scenario;
#define scenario_event_1(event) \
dbg_assert (scenario.current); \
test_within (scenario.t); \
+ while (scenario.current->event_id == SCENARIO_NOP_ID) \
+ scenario.current++; \
test_fail_unless (scenario.current->event_id \
== SCENARIO_EVENT_ ## event); \
scenario.current++
@@ -123,6 +127,10 @@ extern scenario_t scenario;
{ SCENARIO_ACTION_ID, scenario_action_ ## action ## _cb, \
{ .action_ ## action = { params_def } } }
+/** Use this for a no operation in a scenario list of entries. */
+#define SCENARIO_NOP \
+ { SCENARIO_NOP_ID, NULL, { } }
+
/** Use this to mark end of scenario list of entries. */
#define SCENARIO_END \
{ SCENARIO_NULL_ID, NULL, { } }
diff --git a/mac/pbproc/test/pbproc/src/rx_data.c b/mac/pbproc/test/pbproc/src/rx_data.c
index ee0f883d99..c5027d1f42 100644
--- a/mac/pbproc/test/pbproc/src/rx_data.c
+++ b/mac/pbproc/test/pbproc/src/rx_data.c
@@ -78,6 +78,8 @@ rx_data_test (test_t t, test_pbproc_t *tp, u32 date, uint symb_nb, uint pb_nb,
};
const uint pre_fc_fl_tck = MAC_PREAMBLE_TCK + MAC_FC_AV_TCK
+ MAC_FL_TO_TCK (fl_tck / MAC_TCK_PER_FL);
+ uint nb_pb_it = pb_nb > PBPROC_SACKD_ANTICIP_PB_THRESHOLD
+ ? pb_nb - PBPROC_SACKD_ANTICIP_PB_NB : pb_nb;
scenario_entry_t entries[] = {
SCENARIO_ACTION (phy_rx_fc, .rx_date = date, .prp_won = prp_won,
.slot_count = 2,
@@ -91,9 +93,15 @@ rx_data_test (test_t t, test_pbproc_t *tp, u32 date, uint symb_nb, uint pb_nb,
.tonemap_index = 0, .symbol_nb = symb_nb),
SCENARIO_EVENT (phy_pbdma_start, .bypass_aes = !encrypted,
.nb_total = pb_nb, .nb_ready = pb_nb,
+ .nb_pb_it = nb_pb_it),
+ SCENARIO_ACTION (phy_access, .access_param = NULL, .prp_won = true,
+ .slot_count = 0),
+ /* if (pb_nb != nb_pb_it) { */
+ SCENARIO_EVENT (phy_pbdma_update, .nb_ready = pb_nb,
.nb_pb_it = pb_nb),
SCENARIO_ACTION (phy_access, .access_param = NULL, .prp_won = true,
.slot_count = 0),
+ /* } */
SCENARIO_EVENT (phy_tx_param, .fc_mode = PHY_FC_MODE_AV_1,
.short_ppdu = true),
SCENARIO_EVENT (phy_tx_frame, .date = date + pre_fc_fl_tck,
@@ -109,6 +117,11 @@ rx_data_test (test_t t, test_pbproc_t *tp, u32 date, uint symb_nb, uint pb_nb,
};
if (!prp_won)
entries[1].event_id = SCENARIO_EVENT_ca_backoff_cancel;
+ if (pb_nb == nb_pb_it)
+ {
+ entries[6].event_id = SCENARIO_NOP_ID;
+ entries[7].event_id = SCENARIO_NOP_ID;
+ }
scenario_globals_t globals = {
.tp = tp,
};
@@ -212,6 +225,10 @@ rx_data_basic_test_case (test_t t)
rx_data_test (t, &tp, 54621, 1, 1, 1, false, 5, 10, false, false, 0);
rx_data_test (t, &tp, 54621, 2, 2, 2, false, 5, 10, false, false, 0);
} test_end;
+ test_begin (t, "tm unicast large")
+ {
+ rx_data_test (t, &tp, 541, 25, 41, 41, false, 5, 10, false, false, 0);
+ } test_end;
test_begin (t, "robo unicast encrypted sta unknown")
{
rx_data_test (t, &tp, 5462132, 91, 5, 5, false, PHY_MOD_ROBO, 0,
diff --git a/mac/pbproc/test/pbproc/src/scenario.c b/mac/pbproc/test/pbproc/src/scenario.c
index 79caa4b086..60c2b35e71 100644
--- a/mac/pbproc/test/pbproc/src/scenario.c
+++ b/mac/pbproc/test/pbproc/src/scenario.c
@@ -31,11 +31,16 @@ scenario_run (test_t t, scenario_entry_t *entries,
/* Run. */
while (scenario.current->event_id != SCENARIO_NULL_ID)
{
- test_fail_unless (scenario.current->event_id == SCENARIO_ACTION_ID,
- "Expected event did not occurs at %d",
- scenario.current - scenario.entries);
- scenario_entry_t *action = scenario.current++;
- action->action_cb (globals, &action->params);
+ if (scenario.current->event_id == SCENARIO_NOP_ID)
+ scenario.current++;
+ else
+ {
+ test_fail_unless (scenario.current->event_id == SCENARIO_ACTION_ID,
+ "Expected event did not occurs at %d",
+ scenario.current - scenario.entries);
+ scenario_entry_t *action = scenario.current++;
+ action->action_cb (globals, &action->params);
+ }
}
/* Uninitialise the scenario. */
scenario.t = NULL;