summaryrefslogtreecommitdiff
path: root/cesar/cp/conn
diff options
context:
space:
mode:
authorlaranjeiro2008-10-06 08:19:05 +0000
committerlaranjeiro2008-10-06 08:19:05 +0000
commit71772f5501036ebeaa69bdaed9886cb275d12f1f (patch)
treed38404264a65a03eb375bdeb81236c38cd54eda0 /cesar/cp/conn
parent48f7c21d6a1ce106eef4c53f35c957535fae1a2a (diff)
cp/conn: Fixed the unit tests.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@3160 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp/conn')
-rw-r--r--cesar/cp/conn/test/Makefile5
-rw-r--r--cesar/cp/conn/test/override/cl/inc/context.h24
-rw-r--r--cesar/cp/conn/test/override/cp/inc/context.h4
-rw-r--r--cesar/cp/conn/test/override/mac/sar/inc/context.h23
-rw-r--r--cesar/cp/conn/test/src/cl_stub.c9
-rw-r--r--cesar/cp/conn/test/src/sar_stub.c35
6 files changed, 98 insertions, 2 deletions
diff --git a/cesar/cp/conn/test/Makefile b/cesar/cp/conn/test/Makefile
index 0544824f98..9846f36b78 100644
--- a/cesar/cp/conn/test/Makefile
+++ b/cesar/cp/conn/test/Makefile
@@ -4,11 +4,12 @@ INCLUDES = cp/conn/test/override/
HOST_PROGRAMS = conn_test conn_mgr_test
-conn_test_SOURCES = conn_test.c msg_stub.c pwl_stub.c fsm_stub.c cl_stub.c
+conn_test_SOURCES = conn_test.c msg_stub.c pwl_stub.c fsm_stub.c cl_stub.c \
+ sar_stub.c
conn_test_MODULES = lib cp/conn cp/sta/mgr cp/cco/bw mac/common
conn_mgr_test_SOURCES = conn_mgr_test.c msg_stub.c pwl_stub.c fsm_stub.c \
- cl_stub.c
+ cl_stub.c sar_stub.c
conn_mgr_test_MODULES = lib cp/conn cp/sta/mgr cp/cco/bw mac/common
include $(BASE)/common/make/top.mk
diff --git a/cesar/cp/conn/test/override/cl/inc/context.h b/cesar/cp/conn/test/override/cl/inc/context.h
new file mode 100644
index 0000000000..ea3c875207
--- /dev/null
+++ b/cesar/cp/conn/test/override/cl/inc/context.h
@@ -0,0 +1,24 @@
+#ifndef override_cl_inc_context_h
+#define override_cl_inc_context_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file override/cl/inc/context.h
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+#include "cl/cl_mactotei.h"
+
+struct cl_t
+{
+ cl_mactotei_t *mactotei;
+};
+
+#endif /* override_cl_inc_context_h */
diff --git a/cesar/cp/conn/test/override/cp/inc/context.h b/cesar/cp/conn/test/override/cp/inc/context.h
index 16475f0a00..94a977657e 100644
--- a/cesar/cp/conn/test/override/cp/inc/context.h
+++ b/cesar/cp/conn/test/override/cp/inc/context.h
@@ -24,6 +24,8 @@
#include "mac/common/config.h"
#include "mac/common/store.h"
+#include "mac/sar/inc/context.h"
+
struct cp_t
{
cp_conn_mgr_t conn_mgr;
@@ -34,6 +36,8 @@ struct cp_t
mac_config_t *mac_config;
mac_store_t *mac_store;
+
+ sar_t *sar;
};
#endif /* overide_cp_inc_context_h */
diff --git a/cesar/cp/conn/test/override/mac/sar/inc/context.h b/cesar/cp/conn/test/override/mac/sar/inc/context.h
new file mode 100644
index 0000000000..9e7c6f07ca
--- /dev/null
+++ b/cesar/cp/conn/test/override/mac/sar/inc/context.h
@@ -0,0 +1,23 @@
+#ifndef overide_mac_sar_inc_context_h
+#define overide_mac_sar_inc_context_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file overide/mac/sar/inc/context.h
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+
+struct sar_t
+{
+ mac_store_t *mac_store;
+};
+
+#endif /* overide_mac_sar_inc_context_h */
diff --git a/cesar/cp/conn/test/src/cl_stub.c b/cesar/cp/conn/test/src/cl_stub.c
index dc1fb2d235..f850e94a7c 100644
--- a/cesar/cp/conn/test/src/cl_stub.c
+++ b/cesar/cp/conn/test/src/cl_stub.c
@@ -65,3 +65,12 @@ cl_mactotei_use_table (cl_t *ctx, cl_mactotei_blk_t *table)
{
}
+/**
+ * Release the complete table from the memory.
+ *
+ * \param ctx the cl context.
+ */
+void
+cl_mactotei_release_table (cl_t *ctx)
+{
+}
diff --git a/cesar/cp/conn/test/src/sar_stub.c b/cesar/cp/conn/test/src/sar_stub.c
new file mode 100644
index 0000000000..6999c04bd6
--- /dev/null
+++ b/cesar/cp/conn/test/src/sar_stub.c
@@ -0,0 +1,35 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file src/sar_stub.c
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+#include "common/std.h"
+#include "mac/sar/sar.h"
+#include "mac/sar/inc/context.h"
+
+/**
+ * Remove a station from the SAR and the mac store.
+ * \param ctx the CP context.
+ * \param tei the station tei.
+ *
+ * Remove all the MFS from the expiration mechanism of the SAR and ends to
+ * remove the station from the mac store.
+ */
+void
+sar_sta_remove (sar_t *ctx, u8 tei)
+{
+ dbg_assert (ctx);
+ dbg_assert (ctx->mac_store);
+ dbg_assert (tei);
+
+ dbg_check (mac_store_sta_remove (ctx->mac_store, tei));
+}