summaryrefslogtreecommitdiff
path: root/mac/sar/test/unit_test/ecos
diff options
context:
space:
mode:
authorlaranjeiro2008-02-28 10:49:21 +0000
committerlaranjeiro2008-02-28 10:49:21 +0000
commitb00f0c28cb90d70d2fefa4bfc2dd19f98d706e3d (patch)
tree39696d15355f8d654a7d4a738411e94fbe3e3a36 /mac/sar/test/unit_test/ecos
parentdec2216a7cc65cf7205b07a00f99b4b501f56e57 (diff)
Prepare the sar to check the encryption of the frames.
Removed the use of the buffer_address_list_t type in the sar to use the circular_buffer present in the lib directory. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1487 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'mac/sar/test/unit_test/ecos')
-rw-r--r--mac/sar/test/unit_test/ecos/Makefile6
-rw-r--r--mac/sar/test/unit_test/ecos/src/crc_error.c2
-rw-r--r--mac/sar/test/unit_test/ecos/src/reassembly_complete.c4
-rw-r--r--mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c2
-rw-r--r--mac/sar/test/unit_test/ecos/src/sar_buffer_address.c113
-rw-r--r--mac/sar/test/unit_test/ecos/src/sar_call_back_ul.c10
6 files changed, 11 insertions, 126 deletions
diff --git a/mac/sar/test/unit_test/ecos/Makefile b/mac/sar/test/unit_test/ecos/Makefile
index 8da543e19c..a8bf2fe7c3 100644
--- a/mac/sar/test/unit_test/ecos/Makefile
+++ b/mac/sar/test/unit_test/ecos/Makefile
@@ -4,7 +4,7 @@ ECOS = y
TARGET_PROGRAMS = reassembly_complete rea_cov_test \
reassembly_create_mfs lib_sar_mfs reassembly_measurement \
- reassembly_mfs_update_expiration_date sar_buffer_address sar_call_back_ul \
+ reassembly_mfs_update_expiration_date sar_call_back_ul \
sar_manage_expiration lib_sar_expiration sar_mf_function_test \
sar_mfs_resising segmentation_complete test_store_memory test_crc_error
@@ -35,10 +35,6 @@ reassembly_mfs_update_expiration_date_SOURCES = reassembly_mfs_update_expiration
reassembly_mfs_update_expiration_date_MODULES = lib mac/sar mac/common \
mac/sar/bridgedma mac/sar/test mac/pbproc
-sar_buffer_address_SOURCES = sar_buffer_address.c
-sar_buffer_address_MODULES = lib mac/common mac/sar mac/sar/bridgedma \
- mac/pbproc mac/sar/test
-
sar_call_back_ul_SOURCES = sar_call_back_ul.c
sar_call_back_ul_MODULES = lib mac/common mac/sar mac/sar/bridgedma \
mac/pbproc mac/sar/test
diff --git a/mac/sar/test/unit_test/ecos/src/crc_error.c b/mac/sar/test/unit_test/ecos/src/crc_error.c
index 4f013dc59c..0c6173a9eb 100644
--- a/mac/sar/test/unit_test/ecos/src/crc_error.c
+++ b/mac/sar/test/unit_test/ecos/src/crc_error.c
@@ -53,7 +53,7 @@ void rea_comp_sar_rea_done_with_one_pb (void *user, u8* buffer, uint length,
}
void rea_comp_sar_rea_done (void *user, u8* buffer, uint length,
- mfs_rx_t *mfs)
+ mfs_rx_t *mfs, bool encrypted)
{
if (length != list[cpt] - 10)
bool_test = true;
diff --git a/mac/sar/test/unit_test/ecos/src/reassembly_complete.c b/mac/sar/test/unit_test/ecos/src/reassembly_complete.c
index 019343f192..2468395e6e 100644
--- a/mac/sar/test/unit_test/ecos/src/reassembly_complete.c
+++ b/mac/sar/test/unit_test/ecos/src/reassembly_complete.c
@@ -44,13 +44,13 @@ phy_t *phy;
bool bool_test;
void rea_comp_sar_rea_done_with_one_pb (void *user, u8* buffer, uint length,
- mfs_rx_t *mfs)
+ mfs_rx_t *mfs, bool encrypted)
{
cpt ++;
}
void rea_comp_sar_rea_done (void *user, u8* buffer, uint length,
- mfs_rx_t *mfs)
+ mfs_rx_t *mfs, bool encrypted)
{
if (length != list[cpt] - 10)
bool_test = true;
diff --git a/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c b/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c
index e4e6f445cf..5968521912 100644
--- a/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c
+++ b/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c
@@ -46,7 +46,7 @@ bool ce_measurement_cb_stub (void *user,
}
-void sar_reassembly_done_stub (void *user, u8* buffer, uint length, mfs_rx_t *mfs)
+void sar_reassembly_done_stub (void *user, u8* buffer, uint length, mfs_rx_t *mfs, bool encrypted)
{
dbg_assert (user);
dbg_assert (buffer);
diff --git a/mac/sar/test/unit_test/ecos/src/sar_buffer_address.c b/mac/sar/test/unit_test/ecos/src/sar_buffer_address.c
deleted file mode 100644
index b20070fda2..0000000000
--- a/mac/sar/test/unit_test/ecos/src/sar_buffer_address.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2007 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file buffer_address.c
- * \brief test the address list of buffer for the tx, rx data, rx msg
- * \ingroup mac/sar/test/buffer_address
- *
- * The list of addresses will be stocked in a block divided in three zones.
- */
-#include "common/std.h"
-#include "mac/sar/sar.h"
-#include "lib/test.h"
-#include "lib/trace.h"
-
-#include "mac/common/config.h"
-#include "mac/common/ntb.h"
-#include "mac/pbproc/pbproc.h"
-#include "hal/phy/phy.h"
-
-#include "mac/sar/inc/sar_context.h"
-#include "mac/sar/inc/sar.h"
-
-#include "mac/sar/test/inc/sar_unit_test_functions.h"
-
-int main (void)
-{
- test_t test;
- sar_t *sar_ctx;
-
- sar_work_message_t *work;
- mfs_rx_t *mfs;
- mac_store_t *mac_store;
- bool added;
- u8 buffer [1024];
- mac_config_t *mac_config;
- pbproc_t *pbproc;
- ca_t *ca;
- phy_t *phy;
-
- trace_init ();
-
- mac_store = mac_store_init ();
- mac_config = blk_alloc ();
- phy = blk_alloc ();
-
- mac_ntb_init (phy, mac_config);
- pbproc = pbproc_init (mac_config, mac_store);
- ca = blk_alloc ();
- sar_ctx = sar_init (mac_store, pbproc, ca);
-
- sar_init_mme_context (sar_ctx, &sar_ctx);
- sar_init_reassembly_mme_cb (sar_ctx, NULL);
- sar_ctx->data_ctx.number_of_slots = SAR_NUMBER_OF_SLOTS_DATA;
- buffer_address_init (&sar_ctx->data_ctx.buffer_address_list,
- sar_ctx->data_ctx.number_of_slots);
-
- mfs = mac_store_mfs_add_rx (mac_store, false, false, 1, 1, &added);
- dbg_assert (added);
- sar_mfs_add (sar_ctx, (mfs_t *) mfs);
-
- sar_data_buffer_add (sar_ctx, buffer);
-
- work = sar_work_get (sar_ctx);
-
- buffer_address_list_add (&work->ctx->buffer_address_list,
- work->msg.buffer_addr, work->ctx->number_of_slots);
-
- test_init (test, 0, NULL);
- test_begin(test, "sar_add_buffer")
- {
- test_fail_if(&sar_ctx->data_ctx.buffer_address_list != &(work->ctx)->buffer_address_list, "The ctx given does not correspond");
- test_fail_if((work->ctx)->buffer_address_list.curr_slot != 0, "The list had been initialized");
- test_fail_if((work->ctx)->buffer_address_list.slots[0] != work->msg.buffer_addr, "The buffer address given does not correspond");
- }
- test_end;
-
- // printf ("Result \n");
- // printf ("list given : %p, list used : %p\n",
- // &sar_ctx->data_ctx.buffer_address_list, &(work->ctx)->buffer_address_list);
- // printf ("list current slot : %d\n", (work->ctx)->buffer_address_list.curr_slot);
- // list = &(work->ctx)->buffer_address_list;
- // printf ("list current @ : %x\n", (work->ctx)->buffer_address_list.slots[0]);
-
- blk_release (work);
-
- mac_store_mfs_remove (mac_store, (mfs_t *) mfs);
- dbg_check (mac_store_sta_remove (mac_store, 1));
- mac_store_uninit (mac_store);
-
- sar_uninit (sar_ctx);
- pbproc_uninit (pbproc);
-
- mac_ntb_uninit();
- blk_release (mfs);
- blk_release (mac_config);
- blk_release (ca);
- blk_release (phy);
-
- test_begin (test, "Memory test")
- {
- test_fail_if (blk_check_memory() == false, "Memory not freed");
- }
- test_end;
-
- test_result (test);
- HAL_PLATFORM_EXIT (test_nb_failed (test) == 0 ? 0 : 1);
- return test_nb_failed (test) == 0 ? 0 : 1;
-}
diff --git a/mac/sar/test/unit_test/ecos/src/sar_call_back_ul.c b/mac/sar/test/unit_test/ecos/src/sar_call_back_ul.c
index afa1150067..ee2262204d 100644
--- a/mac/sar/test/unit_test/ecos/src/sar_call_back_ul.c
+++ b/mac/sar/test/unit_test/ecos/src/sar_call_back_ul.c
@@ -43,7 +43,7 @@ void sar_segmentation_ul_done (void *user, u8* buffer);
* \param user, User data
*/
void sar_reassembly_ul_done (void *user, u8* buffer, uint length,
- mfs_rx_t *mfs);
+ mfs_rx_t *mfs, bool encrypted);
/**
* Implementation of the sar_beacon_cb_t call back
@@ -86,7 +86,8 @@ int main (void)
bool_rea_test = false;
bool_beacon_test = false;
(*sar_ctx->sar_seg_data_done_cb) (sar_ctx->ul_data_ctx, NULL);
- (*sar_ctx->data_ctx.sar_rea_done) (sar_ctx->ul_data_ctx, NULL, 123, NULL);
+ (*sar_ctx->data_ctx.sar_rea_done) (sar_ctx->ul_data_ctx, NULL, 123, NULL,
+ true);
test_init (test, 0, NULL);
test_begin(test, "sar_call_back_cl")
@@ -102,7 +103,8 @@ int main (void)
sar_init_reassembly_mme_cb (sar_ctx, sar_reassembly_ul_done);
(*sar_ctx->sar_seg_msg_done_cb) (sar_ctx->ul_msg_ctx, NULL);
- (*sar_ctx->mme_ctx.sar_rea_done) (sar_ctx->ul_msg_ctx, NULL, 123, NULL);
+ (*sar_ctx->mme_ctx.sar_rea_done) (sar_ctx->ul_msg_ctx, NULL, 123, NULL,
+ true);
test_begin(test, "sar_call_back_cl")
{
@@ -157,7 +159,7 @@ void sar_segmentation_ul_done (void *user, u8* buffer)
* \param user, User data
*/
void sar_reassembly_ul_done (void *user, u8* buffer, uint length,
- mfs_rx_t *mfs)
+ mfs_rx_t *mfs, bool encrypted)
{
bool_rea_test = true;
//printf ("sar_reassembly_done\n");