summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/test
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/ce/rx/bitloading/test')
-rw-r--r--cesar/ce/rx/bitloading/test/intervals/src/test_fsm.c2
-rw-r--r--cesar/ce/rx/bitloading/test/intervals/src/test_intervals_fsm.c18
-rw-r--r--cesar/ce/rx/bitloading/test/src/test_intervals.c24
3 files changed, 27 insertions, 17 deletions
diff --git a/cesar/ce/rx/bitloading/test/intervals/src/test_fsm.c b/cesar/ce/rx/bitloading/test/intervals/src/test_fsm.c
index ad78abe640..6d9caff593 100644
--- a/cesar/ce/rx/bitloading/test/intervals/src/test_fsm.c
+++ b/cesar/ce/rx/bitloading/test/intervals/src/test_fsm.c
@@ -239,7 +239,7 @@ test_ce_rx_bl_fsm_INTERVALS (test_t t)
tonemaps_t rx_tms;
sta.rx_tonemaps = &rx_tms;
sta.rx_tonemaps->default_tmi = tested_tmi;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
ce_rx_bitloading_init (&sta.ce_rx_bt);
test_case_begin (t, "INTERVALS, sound is received");
diff --git a/cesar/ce/rx/bitloading/test/intervals/src/test_intervals_fsm.c b/cesar/ce/rx/bitloading/test/intervals/src/test_intervals_fsm.c
index 6a7f697ba7..f6482c90f2 100644
--- a/cesar/ce/rx/bitloading/test/intervals/src/test_intervals_fsm.c
+++ b/cesar/ce/rx/bitloading/test/intervals/src/test_intervals_fsm.c
@@ -69,7 +69,7 @@ test_ce_rx_bl_fsm_INTERVAL_TRACKING (test_t t)
measure.rx_params.sound_complete = false;
sta_t sta;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi + 1);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi + 1);
tonemaps_t rx_tms, tx_tms;
sta.rx_tonemaps = &rx_tms;
@@ -130,7 +130,7 @@ test_ce_rx_bl_fsm_INTERVAL_TRACKING (test_t t)
ce_rx_bl_intervals_free (sta.intervals);
sta.rx_tonemaps->default_tmi = tested_tmi;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
test_begin (t, "The tonemap used in intervals is the default tonemap.")
{
@@ -179,7 +179,7 @@ test_ce_rx_bl_fsm_INTERVAL_TRACKING (test_t t)
tested_tmi = 0; /* Mode Robo */
sta.rx_tonemaps->default_tmi = tested_tmi + 1;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
test_begin (t, "The tonemap used in intervals is a ROBO mode.")
{
@@ -244,7 +244,7 @@ test_ce_rx_bl_fsm_INTERVAL_TRACKING (test_t t)
tested_tmi = TONEMAP_INDEX_NEGOTIATED_FIRST;
sta.rx_tonemaps->default_tmi = tested_tmi;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
measure.rx_params.tmi_av = tested_tmi + 1;
tonemap_t tm;
rx_tms.tm[tested_tmi] = &tm;
@@ -271,7 +271,7 @@ test_ce_rx_bl_fsm_INTERVAL_TRACKING (test_t t)
tested_tmi = TONEMAP_INDEX_NEGOTIATED_FIRST;
sta.rx_tonemaps->default_tmi = tested_tmi;
sta.rx_tonemaps->tm[tested_tmi]->ber_target = 1664;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
measure.rx_params.tmi_av = tested_tmi;
measure.false_pb_count = ce_rx_bl_min_pb_per_frame_;
measure.total_pb_count = 1 + ce_rx_bl_min_pb_per_frame_ +
@@ -395,7 +395,7 @@ test_ce_rx_bl_fsm_INTERVAL_TRACKING (test_t t)
tested_tmi = 0; /* ROBO */
sta.rx_tonemaps->default_tmi = tested_tmi;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
measure.rx_params.tmi_av = tested_tmi;
sta.intervals->intervals[tested_fsm_id]->
ber_sliding_mean[CE_RX_BL_BER_SLIDING_MEAN_FAST] = 0;
@@ -455,7 +455,7 @@ test_ce_rx_bl_fsm_INTERVAL_TRACKING (test_t t)
sta.rx_tonemaps->tm[tested_tmi]->bits_per_symbol = 0;
sta.rx_tonemaps->tm[tested_tmi]->ber_target_reached = 42;
ce.mac_config->tonemask_info.carrier_nb = 42;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
measure.rx_params.tmi_av = tested_tmi;
sta.intervals->intervals[tested_fsm_id]->
ber_sliding_mean[CE_RX_BL_BER_SLIDING_MEAN_FAST] = 0;
@@ -532,7 +532,7 @@ test_ce_rx_bl_fsm_INTERVAL_SOUND (test_t t)
measure.rx_params.sound_complete = false;
sta_t sta;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
tonemaps_t rx_tms;
sta.rx_tonemaps = &rx_tms;
sta.rx_tonemaps->default_tmi = tested_tmi;
@@ -655,7 +655,7 @@ test_ce_rx_bl_fsm_INTERVAL_SOUND_WAIT (test_t t)
measure.rx_params.sound_complete = false;
sta_t sta;
- sta.intervals = ce_rx_bl_intervals_alloc (tested_tmi);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, tested_tmi);
tonemaps_t rx_tms;
rx_tms.default_tmi = tested_tmi;
sta.rx_tonemaps = &rx_tms;
diff --git a/cesar/ce/rx/bitloading/test/src/test_intervals.c b/cesar/ce/rx/bitloading/test/src/test_intervals.c
index 3468efd333..a12de594d0 100644
--- a/cesar/ce/rx/bitloading/test/src/test_intervals.c
+++ b/cesar/ce/rx/bitloading/test/src/test_intervals.c
@@ -34,18 +34,23 @@ test_suite_ce_rx_bl_intervals_init (test_t t)
{
test_case_begin (t, "Intervals init/uninit");
+ ce_rx_bitloading_t default_bl;
+
test_begin (t, "Intervals alloc")
{
ce_rx_bitloading_intervals_t *its = NULL;
- its = ce_rx_bl_intervals_alloc (42);
+ its = ce_rx_bl_intervals_alloc (&default_bl, 42);
test_fail_if (its == NULL);
ce_rx_bl_intervals_free (its);
} test_end;
test_begin (t, "Intervals bit-loading init.")
{
- ce_rx_bitloading_intervals_t *its = ce_rx_bl_intervals_alloc (42);
int i;
+ for (i = 0; i < CE_RX_BL_DATE_CRITERIA_NB; i++)
+ default_bl.next_date_min_for_restart_rtc_date[i] = i + 1664;
+ ce_rx_bitloading_intervals_t *its = ce_rx_bl_intervals_alloc (
+ &default_bl, 42);
for (i = 0; i < ce_rx_bl_intervals_fsm_count_; i++)
{
ce_rx_bitloading_t *b = (ce_rx_bitloading_t *)
@@ -54,6 +59,10 @@ test_suite_ce_rx_bl_intervals_init (test_t t)
test_fail_unless (its->intervals[i]->fsm ==
CE_RX_BL_FSM_STATE_INTERVAL_TRACKING);
test_fail_unless (its->tmi[i] == 42);
+ int j;
+ for (j = 0; j < CE_RX_BL_DATE_CRITERIA_NB; j++)
+ test_fail_unless (its->intervals[i]->next_date_min_for_restart_rtc_date[j]
+ == default_bl.next_date_min_for_restart_rtc_date[j]);
}
ce_rx_bl_intervals_free (its);
} test_end;
@@ -79,7 +88,8 @@ test_suite_ce_rx_bl_intervals_get_tmi_used_list (test_t t)
sta_t sta;
sta.rx_tonemaps = tonemaps_alloc ();
- sta.intervals = ce_rx_bl_intervals_alloc (TONEMAP_INDEX_NEGOTIATED_FIRST);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt,
+ TONEMAP_INDEX_NEGOTIATED_FIRST);
test_case_begin (t, "Get tonemaps used list");
test_begin (t, "Including default one.")
@@ -503,7 +513,7 @@ test_suite_ce_rx_bl_intervals_update_tmi (test_t t)
sta_t sta;
sta_init (&sta, 42);
- sta.intervals = ce_rx_bl_intervals_alloc (0);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, 0);
for (i = 0; i < ce_rx_bl_intervals_fsm_count_; i++)
sta.intervals->tmi[i] = i;
ce_rx_bl_intervals_update_tmi (&sta, BSU_ACLF_BP_50HZ_TCK);
@@ -526,7 +536,7 @@ test_suite_ce_rx_bl_intervals_update_tmi (test_t t)
sta_t sta;
sta_init (&sta, 42);
- sta.intervals = ce_rx_bl_intervals_alloc (0);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, 0);
bsu_aclf_bp_t bp_th_tck[3] = {BSU_ACLF_BP_50HZ_TCK,
BSU_ACLF_BP_55HZ_TCK,
@@ -573,7 +583,7 @@ test_suite_ce_rx_bl_intervals_update_default_tm (test_t t)
ce_rx_bl_intervals_fsm_count_ = 1;
ce_rx_bl_intervals_repetition_count_ = 1;
- sta.intervals = ce_rx_bl_intervals_alloc (4);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, 4);
test_begin (t, "One interval, not restarting.")
{
@@ -621,7 +631,7 @@ test_suite_ce_rx_bl_intervals_update_default_tm (test_t t)
ce_rx_bl_intervals_fsm_count_ = 6;
ce_rx_bl_intervals_repetition_count_ = 4;
- sta.intervals = ce_rx_bl_intervals_alloc (4);
+ sta.intervals = ce_rx_bl_intervals_alloc (&sta.ce_rx_bt, 4);
test_begin (t, "Several intervals, no one restarting.")
{