summaryrefslogtreecommitdiff
path: root/cesar/bsu/ntb/test/utest/src/ntb_compute.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/bsu/ntb/test/utest/src/ntb_compute.c')
-rw-r--r--cesar/bsu/ntb/test/utest/src/ntb_compute.c27
1 files changed, 25 insertions, 2 deletions
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;
+}