aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2013-12-28 14:41:00 +0100
committerDaniel Willmann <daniel@totalueberwachung.de>2014-01-15 15:23:21 +0100
commit55844795be21e2e59ab6bcede2037f8c74d76505 (patch)
tree522545c0d413216dee9dfd6022bcd32ecd3ca6ee /tests
parent7c3751b10bff1887e4981aa787c913aa4c812da2 (diff)
rlc/tbf: Add function receive_bsn that updates v_r, v_q, v_n
We don't need to expose the mecanics of updating the variables to the outside.
Diffstat (limited to 'tests')
-rw-r--r--tests/types/TypesTest.cpp36
1 files changed, 9 insertions, 27 deletions
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 1ea3229..62c6ed2 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -218,9 +218,7 @@ static void test_rlc_dl_ul_basic()
/* simulate to have received 0, 1 and 5 */
OSMO_ASSERT(ul_win.is_in_window(0));
- ul_win.m_v_n.mark_received(0);
- ul_win.raise_v_r(0);
- count = ul_win.raise_v_q();
+ count = ul_win.receive_bsn(0);
OSMO_ASSERT(ul_win.m_v_n.is_received(0));
OSMO_ASSERT(ul_win.v_q() == 1);
OSMO_ASSERT(ul_win.v_r() == 1);
@@ -236,9 +234,7 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
OSMO_ASSERT(ul_win.is_in_window(1));
- ul_win.m_v_n.mark_received(1);
- ul_win.raise_v_r(1);
- count = ul_win.raise_v_q();
+ count = ul_win.receive_bsn(1);
OSMO_ASSERT(ul_win.m_v_n.is_received(0));
OSMO_ASSERT(ul_win.v_q() == 2);
OSMO_ASSERT(ul_win.v_r() == 2);
@@ -254,9 +250,7 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
OSMO_ASSERT(ul_win.is_in_window(5));
- ul_win.m_v_n.mark_received(5);
- ul_win.raise_v_r(5);
- count = ul_win.raise_v_q();
+ count = ul_win.receive_bsn(5);
OSMO_ASSERT(ul_win.m_v_n.is_received(0));
OSMO_ASSERT(ul_win.v_q() == 2);
OSMO_ASSERT(ul_win.v_r() == 6);
@@ -274,9 +268,7 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.is_in_window(65));
OSMO_ASSERT(ul_win.is_in_window(2));
OSMO_ASSERT(ul_win.m_v_n.is_received(5));
- ul_win.m_v_n.mark_received(65);
- ul_win.raise_v_r(65);
- count = ul_win.raise_v_q();
+ count = ul_win.receive_bsn(65);
OSMO_ASSERT(count == 0);
OSMO_ASSERT(ul_win.m_v_n.is_received(5));
OSMO_ASSERT(ul_win.v_q() == 2);
@@ -293,33 +285,25 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.is_in_window(2));
OSMO_ASSERT(!ul_win.is_in_window(66));
- ul_win.m_v_n.mark_received(2);
- ul_win.raise_v_r(2);
- count = ul_win.raise_v_q();
+ count = ul_win.receive_bsn(2);
OSMO_ASSERT(count == 1);
OSMO_ASSERT(ul_win.v_q() == 3);
OSMO_ASSERT(ul_win.v_r() == 66);
OSMO_ASSERT(ul_win.is_in_window(66));
- ul_win.m_v_n.mark_received(66);
- ul_win.raise_v_r(66);
- count = ul_win.raise_v_q();
+ count = ul_win.receive_bsn(66);
OSMO_ASSERT(count == 0);
OSMO_ASSERT(ul_win.v_q() == 3);
OSMO_ASSERT(ul_win.v_r() == 67);
for (int i = 3; i <= 67; ++i) {
- ul_win.m_v_n.mark_received(i);
- ul_win.raise_v_r(i);
- ul_win.raise_v_q();
+ ul_win.receive_bsn(i);
}
OSMO_ASSERT(ul_win.v_q() == 68);
OSMO_ASSERT(ul_win.v_r() == 68);
- ul_win.m_v_n.mark_received(68);
- ul_win.raise_v_r(68);
- count = ul_win.raise_v_q();
+ count = ul_win.receive_bsn(68);
OSMO_ASSERT(ul_win.v_q() == 69);
OSMO_ASSERT(ul_win.v_r() == 69);
OSMO_ASSERT(count == 1);
@@ -327,9 +311,7 @@ static void test_rlc_dl_ul_basic()
/* now test the wrapping */
OSMO_ASSERT(ul_win.is_in_window(4));
OSMO_ASSERT(!ul_win.is_in_window(5));
- ul_win.m_v_n.mark_received(4);
- ul_win.raise_v_r(4);
- count = ul_win.raise_v_q();
+ count = ul_win.receive_bsn(4);
OSMO_ASSERT(count == 0);
}