aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-14 11:43:04 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-16 19:37:08 +0100
commitd87e1d6ab747423d3668c74d16201a5d967accf0 (patch)
tree6b37bcee7b3e4f0f9d2069cc12321887e971559b /tests
parent61679251472391bf1746eb277b5027caa1ac14ad (diff)
rlc: Do not raise_v_q in receive_bsn
Currently gprs_rlc_ul_window::receive_bsn calls raise_v_q and returns the number of RLC data blocks that can be taken from the queue. This does not fit the EGPRS feature to put 2 independant data blocks in a single RLC block. This commit removes raise_v_q from receive_bsn, hence it must be called explicitely to get the number of processable data blocks. Sponsored-by: On-Waves ehf
Diffstat (limited to 'tests')
-rw-r--r--tests/types/TypesTest.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index be99147..776e051 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -218,7 +218,8 @@ static void test_rlc_dl_ul_basic()
/* simulate to have received 0, 1 and 5 */
OSMO_ASSERT(ul_win.is_in_window(0));
- count = ul_win.receive_bsn(0);
+ ul_win.receive_bsn(0);
+ count = ul_win.raise_v_q();
OSMO_ASSERT(ul_win.m_v_n.is_received(0));
OSMO_ASSERT(ul_win.v_q() == 1);
OSMO_ASSERT(ul_win.v_r() == 1);
@@ -234,7 +235,8 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
OSMO_ASSERT(ul_win.is_in_window(1));
- count = ul_win.receive_bsn(1);
+ ul_win.receive_bsn(1);
+ count = ul_win.raise_v_q();
OSMO_ASSERT(ul_win.m_v_n.is_received(0));
OSMO_ASSERT(ul_win.v_q() == 2);
OSMO_ASSERT(ul_win.v_r() == 2);
@@ -250,7 +252,8 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
OSMO_ASSERT(ul_win.is_in_window(5));
- count = ul_win.receive_bsn(5);
+ ul_win.receive_bsn(5);
+ count = ul_win.raise_v_q();
OSMO_ASSERT(ul_win.m_v_n.is_received(0));
OSMO_ASSERT(ul_win.v_q() == 2);
OSMO_ASSERT(ul_win.v_r() == 6);
@@ -268,7 +271,8 @@ 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));
- count = ul_win.receive_bsn(65);
+ ul_win.receive_bsn(65);
+ count = ul_win.raise_v_q();
OSMO_ASSERT(count == 0);
OSMO_ASSERT(ul_win.m_v_n.is_received(5));
OSMO_ASSERT(ul_win.v_q() == 2);
@@ -285,25 +289,29 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.is_in_window(2));
OSMO_ASSERT(!ul_win.is_in_window(66));
- count = ul_win.receive_bsn(2);
+ ul_win.receive_bsn(2);
+ count = ul_win.raise_v_q();
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));
- count = ul_win.receive_bsn(66);
+ ul_win.receive_bsn(66);
+ count = ul_win.raise_v_q();
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.receive_bsn(i);
+ ul_win.raise_v_q();
}
OSMO_ASSERT(ul_win.v_q() == 68);
OSMO_ASSERT(ul_win.v_r() == 68);
- count = ul_win.receive_bsn(68);
+ ul_win.receive_bsn(68);
+ count = ul_win.raise_v_q();
OSMO_ASSERT(ul_win.v_q() == 69);
OSMO_ASSERT(ul_win.v_r() == 69);
OSMO_ASSERT(count == 1);
@@ -311,7 +319,8 @@ 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));
- count = ul_win.receive_bsn(4);
+ ul_win.receive_bsn(4);
+ count = ul_win.raise_v_q();
OSMO_ASSERT(count == 0);
}