summaryrefslogtreecommitdiff
path: root/cesar/bsu/test/utest/tests.h
diff options
context:
space:
mode:
authorlaranjeiro2010-05-17 09:08:16 +0000
committerlaranjeiro2010-05-17 09:08:16 +0000
commitd86b0f6443693b5c2db8106f9cb3f3f6136cebd7 (patch)
treee819919090141bdb2d65b07a2fa27de3bed4d261 /cesar/bsu/test/utest/tests.h
parent502fd4b44320ff0760eadeb6030241c73925fe10 (diff)
cesar/bsu: add test structure
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7018 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/bsu/test/utest/tests.h')
-rw-r--r--cesar/bsu/test/utest/tests.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/cesar/bsu/test/utest/tests.h b/cesar/bsu/test/utest/tests.h
new file mode 100644
index 0000000000..dd049368d4
--- /dev/null
+++ b/cesar/bsu/test/utest/tests.h
@@ -0,0 +1,105 @@
+#ifndef bsu_test_utest_tests_h
+#define bsu_test_utest_tests_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2010 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file bsu/test/utest/tests.h
+ * \brief Test environment.
+ * \ingroup bsu
+ */
+#include "bsu/bsu.h"
+#include "mac/common/store.h"
+#include "mac/common/config.h"
+#include "mac/pbproc/pbproc.h"
+#include "mac/sar/sar.h"
+
+struct bsu_test_phy_t
+{
+ /** Phy date. */
+ u32 phy_date;
+};
+typedef struct bsu_test_phy_t bsu_test_phy_t;
+
+struct bsu_test_t
+{
+ /** Mac config. */
+ mac_config_t mac_config;
+ /** Mac store. */
+ mac_store_t *mac_store;
+ /** Channel Access context. */
+ ca_t *ca;
+ /** Phy simulated context. */
+ bsu_test_phy_t phy;
+ /** Sar context. */
+ sar_t *sar;
+ /** BSU. */
+ bsu_t *bsu;
+ /** Hal timer. */
+ hal_timer_t *timer;
+};
+typedef struct bsu_test_t bsu_test_t;
+
+BEGIN_DECLS
+
+/**
+ * Initialise the test unit.
+ * \param ctx the tests context.
+ */
+void
+bsu_test_init (bsu_test_t *ctx);
+
+/**
+ * Uninitialise the test unit.
+ * \param ctx the tests context.
+ */
+void
+bsu_test_uninit (bsu_test_t *ctx);
+
+/**
+ * Create a beacon.
+ * \param beacon structure to fill.
+ *
+ * Creates a beacon with 2 regions, 2 non persistent allocations, 2 Persistent
+ * allocations.
+ */
+void
+bsu_test_create_beacon (bsu_test_t *ctx, bsu_beacon_t *beacon);
+
+/**
+ * Verify the data present in the generated beacon are equal to the one in the
+ * bsu beacon.
+ * \param t test context.
+ * \param ctx the bsu_test context.
+ * \param beacon the bsu data beacon.
+ * \param phy_beacon the beacon generated by the bsu.
+ * \param type the beacon type.
+ *
+ * \Warn the TEI in the phy_beacon is compared with the TEI in the mac
+ * config.
+ */
+void
+bsu_test_beacon_check_generation (test_t t, bsu_test_t *ctx,
+ bsu_beacon_t *beacon,
+ pb_beacon_t *phy_beacon,
+ bsu_beacon_type_t type);
+
+/**
+ * Verify the read data corresponds to the one provided to generate the
+ * beacon.
+ * \param t test context.
+ * \param ctx the bsu_test context.
+ * \param beacon the bsu data beacon.
+ * \param sched the schedules filled with the data in the real beacon.
+ */
+void
+bsu_test_beacon_check_read (test_t t, bsu_test_t *ctx, bsu_beacon_t *beacon,
+ bsu_avln_t *sched);
+
+END_DECLS
+
+#endif /* bsu_test_utest_tests_h */