aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2013-12-11 16:51:26 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-12 11:06:40 +0100
commit48df40d2a4ca216f08e8161701918fe5b7bf9edd (patch)
treea3c7d4e8095894815aa0241c47b2df18cc911536
parentf1786a375f0db36398c9c2f17634f9ee2d1f643f (diff)
tests/TypesTest: Check rbb handling in DL
-rw-r--r--tests/types/TypesTest.cpp36
-rw-r--r--tests/types/TypesTest.ok1
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 407f91e..ea9fdbe 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -333,6 +333,42 @@ static void test_rlc_dl_ul_basic()
count = ul_win.raise_v_q(&v_n);
OSMO_ASSERT(count == 0);
}
+
+ {
+ int count;
+ uint8_t rbb[8];
+ uint16_t lost = 0, recv = 0;
+ char show_rbb[65];
+ BTS dummy_bts;
+ gprs_rlc_dl_window dl_win = { 0, };
+ gprs_rlc_v_b v_b;
+
+ v_b.reset();
+
+ OSMO_ASSERT(dl_win.window_empty());
+ OSMO_ASSERT(!dl_win.window_stalled());
+ OSMO_ASSERT(dl_win.distance() == 0);
+
+ dl_win.increment_send();
+ OSMO_ASSERT(!dl_win.window_empty());
+ OSMO_ASSERT(!dl_win.window_stalled());
+ OSMO_ASSERT(dl_win.distance() == 1);
+
+ for (int i = 0; i < 35; ++i) {
+ dl_win.increment_send();
+ OSMO_ASSERT(!dl_win.window_empty());
+ OSMO_ASSERT(dl_win.distance() == i + 2);
+ }
+
+ uint8_t rbb_cmp[8] = { 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff };
+ Decoding::extract_rbb(rbb_cmp, show_rbb);
+ printf("show_rbb: %s\n", show_rbb);
+
+ v_b.update(&dummy_bts, show_rbb, 35, dl_win, &lost, &recv);
+ OSMO_ASSERT(lost == 0);
+ OSMO_ASSERT(recv == 35);
+
+ }
}
int main(int argc, char **argv)
diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok
index 4f5f15f..6ca2717 100644
--- a/tests/types/TypesTest.ok
+++ b/tests/types/TypesTest.ok
@@ -4,3 +4,4 @@ rbb: 00 00 00 00 00 00 00 01
rbb: 00 00 00 00 00 00 00 03
rbb: 00 00 00 00 00 00 00 31
rbb: 10 00 00 00 00 00 00 01
+show_rbb: IIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR