aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2013-11-27 17:56:02 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-12 11:01:13 +0100
commitf86fb7a953cc020d4bc1bdf67179ae69436aa730 (patch)
treead6cce57af05934dcc3c494773d1e1f6bf3287d2
parent8a31f9e016067991b426e0be7637dd38002f1c3e (diff)
tests/TypesTest: Test ssn() and update_rbb() uplink window methods in TypesTest
Test that ssn and rbb are updated correctly.
-rw-r--r--tests/types/TypesTest.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 3859dfb..e269417 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -185,6 +185,8 @@ static void test_rlc_dl_ul_basic()
gprs_rlc_ul_window ul_win = { 0, };
gprs_rlc_v_n v_n;
int count;
+ const char *rbb;
+ char win_rbb[64];
v_n.reset();
@@ -194,6 +196,11 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(!v_n.is_received(0));
+ rbb = "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII";
+ OSMO_ASSERT(ul_win.ssn() == 0);
+ ul_win.update_rbb(&v_n, win_rbb);
+ OSMO_ASSERT(!memcmp(rbb, win_rbb, 64));
+
/* simulate to have received 0, 1 and 5 */
OSMO_ASSERT(ul_win.is_in_window(0));
v_n.mark_received(0);
@@ -204,6 +211,11 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.v_r() == 1);
OSMO_ASSERT(count == 1);
+ rbb = "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIR";
+ OSMO_ASSERT(ul_win.ssn() == 1);
+ ul_win.update_rbb(&v_n, win_rbb);
+ OSMO_ASSERT(!memcmp(rbb, win_rbb, 64));
+
OSMO_ASSERT(ul_win.is_in_window(1));
v_n.mark_received(1);
ul_win.raise_v_r(1, &v_n);
@@ -213,6 +225,11 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.v_r() == 2);
OSMO_ASSERT(count == 1);
+ rbb = "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRR";
+ OSMO_ASSERT(ul_win.ssn() == 2);
+ ul_win.update_rbb(&v_n, win_rbb);
+ OSMO_ASSERT(!memcmp(rbb, win_rbb, 64));
+
OSMO_ASSERT(ul_win.is_in_window(5));
v_n.mark_received(5);
ul_win.raise_v_r(5, &v_n);
@@ -222,6 +239,11 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.v_r() == 6);
OSMO_ASSERT(count == 0);
+ rbb = "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRIIIR";
+ OSMO_ASSERT(ul_win.ssn() == 6);
+ ul_win.update_rbb(&v_n, win_rbb);
+ OSMO_ASSERT(!memcmp(rbb, win_rbb, 64));
+
OSMO_ASSERT(ul_win.is_in_window(65));
OSMO_ASSERT(ul_win.is_in_window(2));
OSMO_ASSERT(v_n.is_received(5));
@@ -233,6 +255,11 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.v_q() == 2);
OSMO_ASSERT(ul_win.v_r() == 66);
+ rbb = "IIIRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIR";
+ OSMO_ASSERT(ul_win.ssn() == 66);
+ ul_win.update_rbb(&v_n, win_rbb);
+ OSMO_ASSERT(!memcmp(rbb, win_rbb, 64));
+
OSMO_ASSERT(ul_win.is_in_window(2));
OSMO_ASSERT(!ul_win.is_in_window(66));
v_n.mark_received(2);