summaryrefslogtreecommitdiff
path: root/cesar/cp2
diff options
context:
space:
mode:
authorboure2008-07-30 08:12:48 +0000
committerboure2008-07-30 08:12:48 +0000
commit1e0aebda08e9af0df6d914b1e3b794cd371fd6b6 (patch)
tree7598be0074b0c4befca9fe1fb14a7a74c376dddd /cesar/cp2
parent064ab264adb44eab1de98bad294b0dc16d547827 (diff)
Bug corrected on the clearing state of the connections and test added
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2686 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp2')
-rw-r--r--cesar/cp2/cco/bw/src/bw.c4
-rw-r--r--cesar/cp2/cco/bw/test/src/bw_test.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/cesar/cp2/cco/bw/src/bw.c b/cesar/cp2/cco/bw/src/bw.c
index 7b16db7e3a..e7222855f4 100644
--- a/cesar/cp2/cco/bw/src/bw.c
+++ b/cesar/cp2/cco/bw/src/bw.c
@@ -388,10 +388,10 @@ cp_cco_bw_clear_conn_state(cp_t *ctx)
conn = cp_conn_get_conn(ctx, prior_conn->cid);
if(conn->new_conn_state == CP_CONN_STATE_IN
- && conn->new_conn_state == CP_CONN_STATE_ADD)
+ || conn->new_conn_state == CP_CONN_STATE_ADD)
conn->old_conn_state = CP_CONN_STATE_IN;
else
- conn->new_conn_state = CP_CONN_STATE_OUT;
+ conn->old_conn_state = CP_CONN_STATE_OUT;
conn->new_conn_state = CP_CONN_STATE_OUT;
diff --git a/cesar/cp2/cco/bw/test/src/bw_test.c b/cesar/cp2/cco/bw/test/src/bw_test.c
index fccc3dc0bc..6b39852a45 100644
--- a/cesar/cp2/cco/bw/test/src/bw_test.c
+++ b/cesar/cp2/cco/bw/test/src/bw_test.c
@@ -977,6 +977,8 @@ test_case_check_conn_state (test_t test)
test_case_begin(test, "Check conn state");
+ conn[1]->new_conn_state = CP_CONN_STATE_OUT;
+
cp_cco_bw_clear_conn_state(&cp);
test_begin(test, "Check clear conn")
@@ -985,6 +987,10 @@ test_case_check_conn_state (test_t test)
"connection clear not effective");
test_fail_if(conn[0]->old_conn_state != CP_CONN_STATE_IN,
"Old state initialisation pb");
+ test_fail_if(conn[1]->new_conn_state != CP_CONN_STATE_OUT,
+ "connection clear not effective");
+ test_fail_if(conn[1]->old_conn_state != CP_CONN_STATE_OUT,
+ "Old state initialisation pb");
}
test_end;