summaryrefslogtreecommitdiff
path: root/cesar/bsu/aclf/test/utest/src/bpsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/bsu/aclf/test/utest/src/bpsd.c')
-rw-r--r--cesar/bsu/aclf/test/utest/src/bpsd.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/cesar/bsu/aclf/test/utest/src/bpsd.c b/cesar/bsu/aclf/test/utest/src/bpsd.c
index 1eb02af309..299a7d835d 100644
--- a/cesar/bsu/aclf/test/utest/src/bpsd.c
+++ b/cesar/bsu/aclf/test/utest/src/bpsd.c
@@ -82,7 +82,7 @@ test_case_aclf_estimate_beacon_period (test_t t)
*((bsu_aclf_bp_t*) &test.aclf->bp) = BSU_ACLF_BP_50HZ_TCK;
*((uint*) &test.aclf->zc) = BSU_ACLF_ZC_50HZ_TCK;
test.aclf->beacon_period = test.aclf->bp;
- test.phy.phy_type = test_phy_type[i];
+ test.phy->phy_type = test_phy_type[i];
for (nb_iter = 0; nb_iter < ac_stable_length; nb_iter ++)
{
bsu_aclf_ac_compute_beacon_period_start_date (test.aclf);
@@ -97,7 +97,7 @@ test_case_aclf_estimate_beacon_period (test_t t)
test_begin (t, "AC stable, ZC = 740 000 tick")
{
bsu_aclf_test_init (&test);
- test.phy.phy_type = TEST_ACLF_PHY_NONE;
+ test.phy->phy_type = TEST_ACLF_PHY_NONE;
*((uint*) &test.aclf->frequency) = BSU_ACLF_FREQ_50HZ;
*((uint*) &test.aclf->bp) = BSU_ACLF_BP_50HZ_TCK;
*((uint*) &test.aclf->zc) = BSU_ACLF_ZC_50HZ_TCK;
@@ -134,7 +134,7 @@ test_case_aclf_compute_bto (test_t t)
{
bsu_aclf_test_init (&test_cco);
bsu_aclf_test_init (&test_sta);
- test_cco.phy.phy_type = test_phy_type[i];
+ test_cco.phy->phy_type = test_phy_type[i];
*((uint*) &test_cco.aclf->frequency) = BSU_ACLF_FREQ_50HZ;
*((uint*) &test_cco.aclf->bp) = BSU_ACLF_BP_50HZ_TCK;
*((uint*) &test_cco.aclf->zc) = BSU_ACLF_ZC_50HZ_TCK;
@@ -145,8 +145,8 @@ test_case_aclf_compute_bto (test_t t)
test_sta.aclf->beacon_period = test_sta.aclf->bp;
for (nb_iter = 0; nb_iter < ac_stable_length; nb_iter ++)
{
- test_cco.phy.phy += tables[i][nb_iter];
- test_cco.phy.zc = test_cco.phy.phy - BSU_ACLF_ZC_50HZ_TCK;
+ test_cco.phy->phy += tables[i][nb_iter];
+ test_cco.phy->zc = test_cco.phy->phy - BSU_ACLF_ZC_50HZ_TCK;
bsu_aclf_ac_compute_beacon_period_start_date (test_cco.aclf);
bsu_aclf_bto (test_cco.aclf, btos_cco, bto_nb);
bsu_aclf_beacon_period_start_date (test_cco.aclf, bpsd_cco,
@@ -189,7 +189,6 @@ test_case_aclf_compute_bto (test_t t)
test_end;
}
-
void
test_case_aclf_shift_bpsd (test_t t)
{
@@ -197,17 +196,19 @@ test_case_aclf_shift_bpsd (test_t t)
test_begin (t, "shift")
{
uint i;
+ u32 now = phy_date ();
bsu_aclf_test_t test;
bsu_aclf_test_init (&test);
- for (i = 0; i < BSU_ACLF_BPSD_NB; i++)
- test.aclf->bpsd[i] = i * BSU_ACLF_BP_50HZ_TCK;
+ for (i = 0; i < COUNT (test.aclf->bpsd); i++)
+ test.aclf->bpsd[i] = i * BSU_ACLF_BP_50HZ_TCK + now;
test.aclf->beacon_period = BSU_ACLF_BP_50HZ_TCK;
+ test.phy->phy = test.aclf->bpsd[1];
bsu_aclf_shift_beacon_period_start_date (test.aclf);
test_fail_unless (
test.aclf->bpsd[1]
== bsu_aclf_beacon_period_start_date_next (test.aclf));
for (i = 0; i < BSU_ACLF_BPSD_NB - 1; i++)
- test_fail_unless (test.aclf->bpsd[i] == (i+1) *
+ test_fail_unless (test.aclf->bpsd[i] == now + (i+1) *
BSU_ACLF_BP_50HZ_TCK);
bsu_aclf_test_uninit (&test);
}