summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorlaranjeiro2010-05-17 09:43:57 +0000
committerlaranjeiro2010-05-17 09:43:57 +0000
commit7e43f28ca65eac7183afb4de8e654e67ef4607c1 (patch)
tree8a27efba1d75ba6183a82f6494cf9662504a23e9 /cesar
parentced2f6e4ce42ed37eb77b576ee7b8ab42fb25bb4 (diff)
cesar/bsu: remove phy context from stubbed functions
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7043 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/bsu/aclf/test/utest/src/freq.c10
-rw-r--r--cesar/bsu/ntb/test/utest/src/ntb.c25
-rw-r--r--cesar/bsu/ntb/test/utest/src/ntb_compute.c27
-rw-r--r--cesar/bsu/test/utest/src/phy.c4
-rw-r--r--cesar/bsu/test/utest/src/tests.c2
5 files changed, 32 insertions, 36 deletions
diff --git a/cesar/bsu/aclf/test/utest/src/freq.c b/cesar/bsu/aclf/test/utest/src/freq.c
index a1a3f9223f..81380b9dc2 100644
--- a/cesar/bsu/aclf/test/utest/src/freq.c
+++ b/cesar/bsu/aclf/test/utest/src/freq.c
@@ -72,11 +72,9 @@ phy_zero_cross (bsu_aclf_test_phy_t *test)
}
u32
-phy_date (phy_t *ctx)
+phy_date (void)
{
- bsu_aclf_test_phy_t *test = (bsu_aclf_test_phy_t *) ctx;
- dbg_assert (ctx);
- phy_zero_cross (test);
- test->phy += 100;
- return test->phy;
+ phy_zero_cross (&test.phy);
+ test.phy.phy += 100;
+ return test.phy.phy;
}
diff --git a/cesar/bsu/ntb/test/utest/src/ntb.c b/cesar/bsu/ntb/test/utest/src/ntb.c
index 8c2d2051d2..af151acc6b 100644
--- a/cesar/bsu/ntb/test/utest/src/ntb.c
+++ b/cesar/bsu/ntb/test/utest/src/ntb.c
@@ -15,8 +15,6 @@
#include "hal/phy/phy.h"
#include "bsu/ntb/test/utest/tests.h"
-#define DELAY_SYSTCK 100000
-
void
test_suite_ntb_compute (test_t test);
@@ -29,26 +27,3 @@ main (int argc, char **argv)
test_result (test);
return test_nb_failed (test) == 0 ? 0 : 1;
}
-
-/** STUBS functions. */
-u32
-phy_sysdate (phy_t *ctx) __attribute__ ((weak));
-
-u32
-phy_sysdate (phy_t *ctx)
-{
- bsu_ntb_test_phy_t *phy = (bsu_ntb_test_phy_t *) ctx;
- dbg_assert (ctx);
- return (phy->preamble_sysdate + DELAY_SYSTCK);
-}
-
-void
-phy_clock_set_numerator (phy_t *ctx, uint numerator)__attribute__((weak));
-
-void
-phy_clock_set_numerator (phy_t *ctx, uint numerator)
-{
- bsu_ntb_test_phy_t *phy = (bsu_ntb_test_phy_t *) ctx;
- dbg_assert (ctx);
- phy->numerator = numerator;
-}
diff --git a/cesar/bsu/ntb/test/utest/src/ntb_compute.c b/cesar/bsu/ntb/test/utest/src/ntb_compute.c
index 8c4a33a70a..ccad2ac07b 100644
--- a/cesar/bsu/ntb/test/utest/src/ntb_compute.c
+++ b/cesar/bsu/ntb/test/utest/src/ntb_compute.c
@@ -21,6 +21,10 @@
#include "freqerr.h"
#include "numerator.h"
+#define DELAY_SYSTCK 100000
+
+static bsu_ntb_test_t t;
+
void
test_case_ntb_ntb_sync (test_t test)
{
@@ -29,7 +33,6 @@ test_case_ntb_ntb_sync (test_t test)
{
s32 val;
uint i;
- bsu_ntb_test_t t;
bsu_ntb_sync_t sync;
bsu_ntb_test_init (&t);
bsu_ntb_init (&sync);
@@ -71,7 +74,6 @@ test_case_ntb_fail_beacons (test_t test)
uint i;
double error;
bsu_ntb_sync_t sync;
- bsu_ntb_test_t t;
bsu_ntb_test_init (&t);
bsu_ntb_init (&sync);
/* Parse beacon_bts table with a step of 5. */
@@ -100,3 +102,24 @@ test_suite_ntb_compute (test_t test)
test_case_ntb_ntb_sync (test);
test_case_ntb_fail_beacons (test);
}
+
+/** STUBS functions. */
+u32
+phy_sysdate (void) __attribute__ ((weak));
+
+u32
+phy_sysdate (void)
+{
+ return (t.phy.preamble_sysdate + DELAY_SYSTCK);
+}
+
+void
+phy_clock_set_numerator (phy_t *ctx, uint numerator)__attribute__((weak));
+
+void
+phy_clock_set_numerator (phy_t *ctx, uint numerator)
+{
+ bsu_ntb_test_phy_t *phy = (bsu_ntb_test_phy_t *) ctx;
+ dbg_assert (ctx);
+ phy->numerator = numerator;
+}
diff --git a/cesar/bsu/test/utest/src/phy.c b/cesar/bsu/test/utest/src/phy.c
index 071f98ef0c..f9ed1856b7 100644
--- a/cesar/bsu/test/utest/src/phy.c
+++ b/cesar/bsu/test/utest/src/phy.c
@@ -23,10 +23,10 @@ phy_clock_get_zero_cross_captured_date (phy_t *ctx)
}
u32
-phy_sysdate (phy_t *ctx) __attribute__((weak));
+phy_sysdate (void) __attribute__((weak));
u32
-phy_sysdate (phy_t *ctx)
+phy_sysdate (void)
{
return 0;
}
diff --git a/cesar/bsu/test/utest/src/tests.c b/cesar/bsu/test/utest/src/tests.c
index d1804717df..428e22ac5e 100644
--- a/cesar/bsu/test/utest/src/tests.c
+++ b/cesar/bsu/test/utest/src/tests.c
@@ -43,7 +43,7 @@ bsu_test_init (bsu_test_t *ctx)
ctx->mac_config.tei = 0x0;
ctx->mac_config.sta_mac_address = 0x123456789abcull;
ctx->mac_store = mac_store_init ();
- ctx->timer = hal_timer_init ((phy_t *) &ctx->phy);
+ ctx->timer = hal_timer_init ();
bsu_aclf_t *aclf = bsu_aclf_init ((phy_t*) &ctx->phy, &ctx->mac_config);
ctx->bsu = bsu_init (aclf, &ctx->mac_config, (phy_t*) &ctx->phy,
ctx->mac_store, (ca_t*) &ctx->ca, (sar_t*) ctx,