aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2013-12-11 16:49:43 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-12 11:03:35 +0100
commit0f2b5fc749a9954c41f05ca7391ffae705468af3 (patch)
treed92c052589f43b02953dc6bb5dbccc444d5e6292
parent5241c1a018a27b1372f3d02c564acb5188b73ee2 (diff)
tests/TypesTest: Print the result of Encoding::encode_rbb()
-rw-r--r--tests/types/TypesTest.cpp12
-rw-r--r--tests/types/TypesTest.ok5
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index cb4f5b6..0f627fc 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -22,6 +22,7 @@
#include "bts.h"
#include "tbf.h"
#include "gprs_debug.h"
+#include "encoding.h"
extern "C" {
#include <osmocom/core/application.h>
@@ -195,6 +196,7 @@ static void test_rlc_dl_ul_basic()
int count;
const char *rbb;
char win_rbb[65];
+ uint8_t bin_rbb[8];
win_rbb[64] = '\0';
v_n.reset();
@@ -209,6 +211,8 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.ssn() == 0);
ul_win.update_rbb(&v_n, win_rbb);
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
+ Encoding::encode_rbb(win_rbb, bin_rbb);
+ printf("rbb: %s\n", osmo_hexdump(bin_rbb, sizeof(bin_rbb)));
/* simulate to have received 0, 1 and 5 */
OSMO_ASSERT(ul_win.is_in_window(0));
@@ -224,6 +228,8 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.ssn() == 1);
ul_win.update_rbb(&v_n, win_rbb);
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
+ Encoding::encode_rbb(win_rbb, bin_rbb);
+ printf("rbb: %s\n", osmo_hexdump(bin_rbb, sizeof(bin_rbb)));
OSMO_ASSERT(ul_win.is_in_window(1));
v_n.mark_received(1);
@@ -238,6 +244,8 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.ssn() == 2);
ul_win.update_rbb(&v_n, win_rbb);
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
+ Encoding::encode_rbb(win_rbb, bin_rbb);
+ printf("rbb: %s\n", osmo_hexdump(bin_rbb, sizeof(bin_rbb)));
OSMO_ASSERT(ul_win.is_in_window(5));
v_n.mark_received(5);
@@ -252,6 +260,8 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.ssn() == 6);
ul_win.update_rbb(&v_n, win_rbb);
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
+ Encoding::encode_rbb(win_rbb, bin_rbb);
+ printf("rbb: %s\n", osmo_hexdump(bin_rbb, sizeof(bin_rbb)));
OSMO_ASSERT(ul_win.is_in_window(65));
OSMO_ASSERT(ul_win.is_in_window(2));
@@ -268,6 +278,8 @@ static void test_rlc_dl_ul_basic()
OSMO_ASSERT(ul_win.ssn() == 66);
ul_win.update_rbb(&v_n, win_rbb);
OSMO_ASSERT_STR_EQ(win_rbb, rbb);
+ Encoding::encode_rbb(win_rbb, bin_rbb);
+ printf("rbb: %s\n", osmo_hexdump(bin_rbb, sizeof(bin_rbb)));
OSMO_ASSERT(ul_win.is_in_window(2));
OSMO_ASSERT(!ul_win.is_in_window(66));
diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok
index 9d0cbfb..4f5f15f 100644
--- a/tests/types/TypesTest.ok
+++ b/tests/types/TypesTest.ok
@@ -1 +1,6 @@
Making some basic type testing.
+rbb: 00 00 00 00 00 00 00 00
+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