summaryrefslogtreecommitdiff
path: root/cesar/cp2/cco/bw/test
diff options
context:
space:
mode:
authorboure2008-07-01 08:43:04 +0000
committerboure2008-07-01 08:43:04 +0000
commit05bf0525b16db3567ba59912d068eb5591995f2e (patch)
tree5ef0903a2f68acb76649fef9b1e4dfac4a7f112a /cesar/cp2/cco/bw/test
parent764a900e19f84e34e317ffdd570d33b6322fa7df (diff)
took off some white spaces
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2502 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp2/cco/bw/test')
-rw-r--r--cesar/cp2/cco/bw/test/src/bw_prio_heap_test.c68
-rw-r--r--cesar/cp2/cco/bw/test/src/bw_test.c26
-rw-r--r--cesar/cp2/cco/bw/test/src/msg_stub.c130
-rw-r--r--cesar/cp2/cco/bw/test/src/pwl_stub.c41
4 files changed, 77 insertions, 188 deletions
diff --git a/cesar/cp2/cco/bw/test/src/bw_prio_heap_test.c b/cesar/cp2/cco/bw/test/src/bw_prio_heap_test.c
index 0cd47dc5b7..70769ab3c3 100644
--- a/cesar/cp2/cco/bw/test/src/bw_prio_heap_test.c
+++ b/cesar/cp2/cco/bw/test/src/bw_prio_heap_test.c
@@ -62,16 +62,16 @@ test_case_bw_prio_heap_init (test_t test, cp_t *cp)
heap[0] = PARENT_OF(cp_cco_bw_prio_heap_t,
node,
list_next(&heap[1]->node));
-
+
test_begin(test,"Init prio heaps"){
- test_fail_if(heap[3]->nb_conn_allocated != 0,
+ test_fail_if(heap[3]->nb_conn_allocated != 0,
"There shouldn't be any connection allocated") ;
- test_fail_if(heap[3]->nb_conn != 0,
+ test_fail_if(heap[3]->nb_conn != 0,
"There shouldn't be any connection");
test_fail_if(heap[3]->table_priority_level != 3,
"The priority is false");
- test_fail_if(heap[1]->table_priority_level != 1,
- "The heaps aren't well linked");
+ test_fail_if(heap[1]->table_priority_level != 1,
+ "The heaps aren't well linked");
}
test_end;
}
@@ -79,7 +79,7 @@ test_case_bw_prio_heap_init (test_t test, cp_t *cp)
* Test the initialisation of the prio heaps
* \param test test paramters
*
- *
+ *
*/
void
@@ -89,9 +89,9 @@ test_case_bw_prio_heap_uninit (test_t test, cp_t *cp)
test_case_begin (test, "Init prio heaps");
cp_cco_bw_uninit(cp);
-
+
test_begin(test,"Init prio heaps"){
- test_fail_if(!list_empty(&cp->bw.prio_heap),
+ test_fail_if(!list_empty(&cp->bw.prio_heap),
"The list should be empty ");
test_fail_if(!blk_check_memory(),
"Memory allocation pb");
@@ -133,10 +133,10 @@ test_case_bw_prio_heap_add_conns (test_t test, cp_t *cp)
for(i=0;i<4;i++)
for(j=0;j<3;j++)
cp_cco_bw_prio_heap_add_conn(cp,cid[j][i],prio[i]);
-
+
test_begin(test,"add connection into prio heaps"){
- test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,node,list_begin(&heap[3]->conns))->cid != 30,
- "failure add : cid prio 3 conn 0");
+ test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,node,list_begin(&heap[3]->conns))->cid != 30,
+ "failure add : cid prio 3 conn 0");
test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,node,list_next(list_begin(&heap[2]->conns)))->cid != 21,
"failure add :cid prio 2 conn 1");
test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,node,list_next(list_next(list_begin(&heap[1]->conns))))->cid != 12,
@@ -181,7 +181,7 @@ test_case_bw_prio_heap_del_conns (test_t test)
cp_cco_bw_prio_heap_del_conn(&cp,32);
cp_cco_bw_prio_heap_add_conn(&cp,35,3);
- //Add last remove all firsts
+ //Add last remove all firsts
cp_cco_bw_prio_heap_add_conn(&cp,25,2);
cp_cco_bw_prio_heap_del_conn(&cp,20);
cp_cco_bw_prio_heap_del_conn(&cp,21);
@@ -191,26 +191,26 @@ test_case_bw_prio_heap_del_conns (test_t test)
cp_cco_bw_prio_heap_del_conn(&cp,12);
cp_cco_bw_prio_heap_add_conn(&cp,12,1);
- //Del first add last
+ //Del first add last
cp_cco_bw_prio_heap_del_conn(&cp,0);
cp_cco_bw_prio_heap_add_conn(&cp,0,0);
test_begin(test,"Del connection into prio heaps"){
- test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,
- node,
+ test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,
+ node,
list_begin(&heap[3]->conns))->cid != 35,
"failure remove all conn + add 1st");
- test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,
- node,
+ test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,
+ node,
list_begin(&heap[2]->conns))->cid !=25,
"failure add 1 remove all");
- test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,
- node,
+ test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,
+ node,
list_next(list_next(list_begin(&heap[1]->conns))))->cid != 12,
"failure remove last add last");
- test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,
- node,
+ test_fail_if(PARENT_OF(cp_cco_bw_prio_conn_t,
+ node,
list_next(list_next(list_begin(&heap[0]->conns))))->cid != 0,
"failure remove first add last");
}
@@ -245,43 +245,43 @@ test_case_bw_prio_get_most_prior_conn (test_t test)
test_case_begin(test, "\nGet most prior conn");
- most_prior_conn[0] = cp_cco_bw_prio_heap_get_most_prior_conn(&cp);
+ most_prior_conn[0] = cp_cco_bw_prio_heap_get_most_prior_conn(&cp);
cp_cco_bw_prio_heap_add_conn(&cp,1,0);
most_prior_conn[1] = cp_cco_bw_prio_heap_get_most_prior_conn(&cp);
-
+
most_prior_conn[1]->alloc_status = true;
cp_cco_bw_prio_heap_add_conn(&cp,2,0);
cp_cco_bw_prio_heap_add_conn(&cp,3,0);
-
+
most_prior_conn[2] = cp_cco_bw_prio_heap_get_most_prior_conn(&cp);
-
+
cp_cco_bw_prio_heap_add_conn(&cp,10,1);
cp_cco_bw_prio_heap_add_conn(&cp,20,2);
cp_cco_bw_prio_heap_add_conn(&cp,21,2);
- most_prior_conn[3] = cp_cco_bw_prio_heap_get_most_prior_conn(&cp);
+ most_prior_conn[3] = cp_cco_bw_prio_heap_get_most_prior_conn(&cp);
cp_cco_bw_prio_heap_add_conn(&cp,30,3);
cp_cco_bw_prio_heap_add_conn(&cp,31,3);
cp_cco_bw_prio_heap_add_conn(&cp,32,3);
- most_prior_conn[4] = cp_cco_bw_prio_heap_get_most_prior_conn(&cp);
+ most_prior_conn[4] = cp_cco_bw_prio_heap_get_most_prior_conn(&cp);
test_begin(test,"Get most prior conn")
{
test_fail_if(most_prior_conn[0] != NULL,
"There shouldn't be any connection");
test_fail_if(most_prior_conn[1]->cid != 1,
- "Only one connection");
+ "Only one connection");
test_fail_if(most_prior_conn[2]->cid != 2,
- "First conn not prior");
+ "First conn not prior");
test_fail_if(most_prior_conn[3]->cid != 20,
- "Priority 2 first element shoud be prior");
+ "Priority 2 first element shoud be prior");
test_fail_if(most_prior_conn[4]->cid != 30,
- "Priority 3 first element shoul be prior");
+ "Priority 3 first element shoul be prior");
}
test_end;
@@ -337,7 +337,7 @@ test_case_bw_prio_get_conn(test_t test)
cp_t cp;
cp_cco_bw_prio_conn_t *conn;
test_case_bw_prio_heap_init(test, &cp);
-
+
cp_cco_bw_prio_heap_add_conn(&cp,10,0);
cp_cco_bw_prio_heap_add_conn(&cp,20,0);
cp_cco_bw_prio_heap_add_conn(&cp,30,0);
@@ -354,7 +354,7 @@ test_case_bw_prio_get_conn(test_t test)
test_end;
test_case_bw_prio_heap_uninit(test, &cp);
-
+
}
int
main (void){
@@ -362,7 +362,7 @@ main (void){
test_init(test, 0, NULL);
- test_case_bw_prio_get_conn(test);
+ test_case_bw_prio_get_conn(test);
test_case_bw_prio_heap_clear_conn(test);
test_case_bw_prio_get_most_prior_conn (test);
test_case_bw_prio_heap_del_conns (test);
diff --git a/cesar/cp2/cco/bw/test/src/bw_test.c b/cesar/cp2/cco/bw/test/src/bw_test.c
index d7f136bf04..5d176310ed 100644
--- a/cesar/cp2/cco/bw/test/src/bw_test.c
+++ b/cesar/cp2/cco/bw/test/src/bw_test.c
@@ -296,7 +296,7 @@ test_case_bw_init_new_sched (test_t test)
end_tdma_glid = end_tdma->glid;
end_tdma_st = end_tdma->st_atu;
end_tdma_et = end_tdma->et_atu;
-
+
test_begin(test,"Init new schedule")
{
test_fail_if(beacon_st != 0,
@@ -347,7 +347,7 @@ test_case_bw_init_new_sched (test_t test)
// blk_release(pco[1]);
}
-void
+void
test_case_get_alloc_ble(test_t test, u8 test_id)
{
u16 i;
@@ -363,7 +363,7 @@ test_case_get_alloc_ble(test_t test, u8 test_id)
cp_sta_mgr_init(&cp);
cp_cco_bw_init(&cp);
cp_cco_bw_new_sched(&cp);
-
+
/*Fill BLE*/
link = cp_link_init();
@@ -399,13 +399,13 @@ test_case_get_alloc_ble(test_t test, u8 test_id)
first_ble_interval = PARENT_OF(cp_link_ble_interval_t, node,list_next(&first_ble_interval->node));
result[i] = cp_cco_bw_get_alloc_ble(first_ble_interval, &last_ble, nb_pb, &first_alloc[i], &last_alloc[i]);
- }
+ }
test_begin(test, "try to find free time to allocate")
{
- test_fail_if(result[0],"there should be enough free time 1");
- test_fail_if(!result[1],"there shouldn't be enough free time 2");
- test_fail_if(result[2],"there should be enough free time 3");
+ test_fail_if(result[0],"there should be enough free time 1");
+ test_fail_if(!result[1],"there shouldn't be enough free time 2");
+ test_fail_if(result[2],"there should be enough free time 3");
}
test_end;
}
@@ -433,7 +433,7 @@ test_case_complete_allocation (test_t test, u8 test_id)
conn[i]->conn_info->cid = (i+1)*100;
conn[i]->conn_info->cspec->f_qmp->av_nb_pb = nb_pb;
conn[i]->conn_info->cspec->f_qmp->nb_txop = 1;
- cp_conn_add_conn(&cp, conn[i]);
+ cp_conn_add_conn(&cp, conn[i]);
/*Init the BLEs*/
for(j=0;j<nb_ble;j++)
@@ -526,11 +526,11 @@ test_case_complete_schedule (test_t test)
cp_link_push_ble(conn[i]->flink, ble_value[j], ble_end_time[j]);
}
}
-
+
test_case_begin(test, "Complete Schedule");
-
+
cp_cco_bw_alloc_sched(&cp);
-
+
alloc_test[0] = cp_cco_bw_get_first_alloc_actual(&cp);
for(i = 1 ; i < 13 ; i++)
@@ -624,7 +624,7 @@ test_case_add_get_alloc(test_t test)
cp_cco_bw_alloc_add(&cp, alloc);
test_alloc = cp_cco_bw_alloc_get_first_txop(&cp, 100);
-
+
test_begin(test, "Add Get Allocation")
{
test_fail_if(test_alloc->st_atu != 1500,
@@ -651,7 +651,7 @@ main (void){
test_case_add_get_alloc(test);
- INIT_TEST_COMPLETE_SCHEDULE(0);
+ INIT_TEST_COMPLETE_SCHEDULE(0);
test_case_complete_schedule (test);
diff --git a/cesar/cp2/cco/bw/test/src/msg_stub.c b/cesar/cp2/cco/bw/test/src/msg_stub.c
index 67a8446abb..1d46d32868 100644
--- a/cesar/cp2/cco/bw/test/src/msg_stub.c
+++ b/cesar/cp2/cco/bw/test/src/msg_stub.c
@@ -20,46 +20,31 @@
#include "cp2/conn/link.h"
#include "cp2/mme.h"
-/**
- * Send a conn add req
- * \param ctx Control Plane context
- * \param peer Peer informations
- * \param data Data to send
- *
- */
-void
-cp_msg_cm_conn_new_req_send(cp_t *ctx,
+void
+cp_msg_cm_conn_new_req_send(cp_t *ctx,
cp_mme_peer_t peer,
cp_msg_cm_conn_new_req_t *data)
{
}
-/**
- * Reception of a CM_CONN_NEW.REQ
- * \param ctx Control Plane context
- * \param mme MME received
- * \param data data to fill
- * \return ture on success
- *
- */
bool
-cp_msg_cm_conn_new_req_receive(cp_t *ctx,
- cp_mme_rx_t *mme,
+cp_msg_cm_conn_new_req_receive(cp_t *ctx,
+ cp_mme_rx_t *mme,
cp_msg_cm_conn_new_req_t *data)
{
return true;
}
void
-cp_msg_cm_conn_new_cnf_sent(cp_t *ctx,
- cp_mme_rx_t *mme,
+cp_msg_cm_conn_new_cnf_sent(cp_t *ctx,
+ cp_mme_rx_t *mme,
cp_msg_cm_conn_new_cnf_t *data)
{
}
bool
-cp_msg_cm_conn_new_cnf_receive(cp_t *ctx,
- cp_mme_rx_t *mme,
+cp_msg_cm_conn_new_cnf_receive(cp_t *ctx,
+ cp_mme_rx_t *mme,
cp_msg_cm_conn_new_cnf_t *data)
{
return true;
@@ -69,56 +54,35 @@ cp_msg_cm_conn_new_cnf_receive(cp_t *ctx,
/* APCM family */
/******************/
void
-cp_msg_apcm_conn_add_req_send(cp_t *ctx,
- cp_mme_rx_t *mme,
+cp_msg_apcm_conn_add_req_send(cp_t *ctx,
+ cp_mme_rx_t *mme,
cp_msg_apcm_conn_add_req_t *data)
{
}
bool
-cp_msg_apcm_conn_add_req_receive(cp_t *ctx,
- cp_mme_rx_t *mme,
+cp_msg_apcm_conn_add_req_receive(cp_t *ctx,
+ cp_mme_rx_t *mme,
cp_msg_apcm_conn_add_req_t *data)
{
return true;
}
-/**
- * Sends a apcm_conn_add.cnf
- * \param ctx Control Plane context
- * \param peer Peer informations
- * \param data Data to send
- *
- */
-void
-cp_msg_apcm_conn_add_cnf_send(cp_t *ctx,
+void
+cp_msg_apcm_conn_add_cnf_send(cp_t *ctx,
cp_mme_peer_t peer,
cp_msg_apcm_conn_add_cnf_t *data)
{
}
-/**
- * Reception of a APCM_CONN_ADD.CNF
- * \param ctx Control Plane context
- * \param mme MME received
- * \param data data to fill
- * \return ture on success
- *
- */
bool
-cp_msg_apcm_conn_add_cnf_receive(cp_t *ctx,
+cp_msg_apcm_conn_add_cnf_receive(cp_t *ctx,
cp_mme_rx_t *mme,
cp_msg_apcm_conn_add_cnf_t *data)
{
return true;
}
-/**
- * Sends a apcm_conn_add.ind
- * \param ctx Control Plane context
- * \param peer Peer informations
- * \param data Data to send
- *
- */
+
void
cp_msg_apcm_conn_add_ind_send(cp_t *ctx,
cp_mme_peer_t peer,
@@ -126,42 +90,21 @@ cp_msg_apcm_conn_add_ind_send(cp_t *ctx,
{
}
-/**
- * Reception of a APCM_CONN_ADD.IND
- * \param ctx Control Plane context
- * \param mme MME received
- * \param data data to fill
- * \return true on success
- *
- */
bool
-cp_msg_apcm_conn_add_ind_receive(cp_t *ctx,
- cp_mme_rx_t *mme,
+cp_msg_apcm_conn_add_ind_receive(cp_t *ctx,
+ cp_mme_rx_t *mme,
cp_msg_apcm_conn_add_ind_t *data)
{
return true;
}
- /**
- * Sends a CM_CONN_REL.IND
- * \param ctx Control Plane context
- * \param peer Peer informations
- * \param data Data to send
- *
- */
+
void
cp_msg_apcm_conn_rel_ind_send(cp_t *ctx,
cp_mme_peer_t peer,
cp_msg_apcm_conn_rel_ind_t *data)
{
}
-/**
- * Reception of a CM_CONN_REL.IND
- * \param ctx Control Plane context
- * \param mme MME received
- * \param data data to fill
- * \return ture on success
- *
- */
+
bool
cp_msg_cm_conn_rel_ind_receive(cp_t *ctx,
cp_mme_rx_t *mme,
@@ -170,13 +113,6 @@ cp_msg_cm_conn_rel_ind_receive(cp_t *ctx,
return true;
}
-/**
- * Sends a CM_CONN_REL.RSP
- * \param ctx Control Plane context
- * \param peer Peer informations
- * \param data Data to send
- *
- */
void
cp_msg_cm_conn_rel_rsp_send(cp_t *ctx,
cp_mme_peer_t peer,
@@ -184,14 +120,6 @@ cp_msg_cm_conn_rel_rsp_send(cp_t *ctx,
{
}
-/**
- * Reception of a CM_CONN_REL.RSP
- * \param ctx Control Plane context
- * \param mme MME received
- * \param data data to fill
- * \return ture on success
- *
- */
bool
cp_msg_cm_conn_rel_rsp_receive(cp_t *ctx,
cp_mme_rx_t *mme,
@@ -201,15 +129,15 @@ cp_msg_cm_conn_rel_rsp_receive(cp_t *ctx,
}
void
-cp_msg_cm_conn_info_req_send(cp_t *ctx,
- cp_mme_peer_t peer,
+cp_msg_cm_conn_info_req_send(cp_t *ctx,
+ cp_mme_peer_t peer,
cp_msg_cm_conn_info_req_t *data)
{
}
bool
-cp_msg_cm_conn_info_req_receive(cp_t *ctx,
- cp_mme_rx_t *mme,
+cp_msg_cm_conn_info_req_receive(cp_t *ctx,
+ cp_mme_rx_t *mme,
cp_msg_cm_conn_info_req_t *data)
{
return true;
@@ -222,12 +150,14 @@ cp_msg_cm_conn_mod_req_receive(cp_t *ctx,
{
return true;
}
+
void
cp_msg_apcm_conn_mod_ind_send(cp_t *ctx,
cp_mme_peer_t peer,
cp_msg_apcm_conn_mod_ind_t *data)
{
}
+
bool
cp_msg_cm_conn_mod_cnf_receive(cp_t *ctx,
cp_mme_rx_t *mme,
@@ -237,8 +167,8 @@ cp_msg_cm_conn_mod_cnf_receive(cp_t *ctx,
}
bool
-cp_msg_cm_conn_info_cnf_receive(cp_t *ctx,
- cp_mme_rx_t *mme,
+cp_msg_cm_conn_info_cnf_receive(cp_t *ctx,
+ cp_mme_rx_t *mme,
cp_msg_cm_conn_info_cnf_t *data)
{
return true;
@@ -251,8 +181,8 @@ cp_msg_apcm_conn_add_rsp_receive(cp_t *ctx,
return true;
}
void
-cp_msg_cm_conn_new_cnf_send(cp_t *ctx,
- cp_mme_peer_t peer,
+cp_msg_cm_conn_new_cnf_send(cp_t *ctx,
+ cp_mme_peer_t peer,
cp_msg_cm_conn_new_cnf_t *data)
{
}
diff --git a/cesar/cp2/cco/bw/test/src/pwl_stub.c b/cesar/cp2/cco/bw/test/src/pwl_stub.c
index eec62e6dca..57ce8c6931 100644
--- a/cesar/cp2/cco/bw/test/src/pwl_stub.c
+++ b/cesar/cp2/cco/bw/test/src/pwl_stub.c
@@ -20,11 +20,6 @@
#include "cp2/inc/context.h"
#include "cp2/pwl/pwl.h"
-/**
- * Initialise the pwl module.
- * \param ctx the module context.
- *
- */
void
cp_pwl_init (cp_t *ctx)
{
@@ -35,39 +30,3 @@ cp_pwl_init (cp_t *ctx)
ctx->pwl.bp_avln_ntb [1] = MAC_ATU_TO_TCK(3906);
}
-/**
- * Compute the frequency of the power line using the pratic register.
- * \param ctx the module context.
- *
- * It shall read the pratic register twice with a gap of 20 ms. This
- * function shall update the data in the object. If the medium is a coaxial
- * cable, the 50Hz will be chosen
- *
- * \warn Only call this function in a Thread.
- */
-void
-cp_pwl_acl_frequency_detection (cp_t *ctx)
-{
-}
-
-/**
- * Estimate the current beacon period.
- * \param ctx the module context.
- *
- */
-void
-cp_pwl_estimate_beacon_period (cp_t *ctx)
-{
-}
-
-/**
- * Uninitialise the PWL module.
- * \param ctx the module context.
- *
- */
-void
-cp_pwl_uninit (cp_t *ctx)
-{
- dbg_assert (ctx);
-}
-