aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-08 17:34:56 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-08 17:37:55 +0100
commitde9da39b336e2b8e05efb59ecabf666f85f39a16 (patch)
tree02b697252b2f5f441589b58a2b1b45841b5ff81a /tests
parentd34646a865364fa51213e0da406aeea2ab7d944b (diff)
tests: edge, tbf: assert return values
Numerous calls assign a return value without asserting its value. Add assertions and thus also eliminate compiler warnings about unused values. Change-Id: I7f14198cfd747dae68b8aaa3b8d6ff7fc49ab824
Diffstat (limited to 'tests')
-rw-r--r--tests/edge/EdgeTest.cpp6
-rw-r--r--tests/tbf/TbfTest.cpp11
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp
index 86c08f5..16a39e9 100644
--- a/tests/edge/EdgeTest.cpp
+++ b/tests/edge/EdgeTest.cpp
@@ -1226,6 +1226,7 @@ static void uplink_header_type_2_parsing_test(BTS *the_bts,
egprs2->pi = 0;
data[4] = 0x20; /* Setting E field */
rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs);
+ OSMO_ASSERT(rc == 487);
offs = rlc.data_offs_bits[0] / 8;
OSMO_ASSERT(offs == 4);
OSMO_ASSERT(rlc.tfi == 1);
@@ -1250,6 +1251,7 @@ static void uplink_header_type_2_parsing_test(BTS *the_bts,
egprs2->pi = 0;
data[10] = 0x20; /* Setting E field */
rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs);
+ OSMO_ASSERT(rc == 679);
offs = rlc.data_offs_bits[0] / 8;
OSMO_ASSERT(offs == 10);
OSMO_ASSERT(rlc.num_data_blocks == 1);
@@ -1271,6 +1273,7 @@ static void uplink_header_type_2_parsing_test(BTS *the_bts,
egprs2->pi = 0;
data[10] = 0x20; /* Setting E field */
rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs);
+ OSMO_ASSERT(rc == 679);
offs = rlc.data_offs_bits[0] / 8;
OSMO_ASSERT(offs == 10);
OSMO_ASSERT(rlc.tfi == 1);
@@ -1330,6 +1333,7 @@ static void uplink_header_type_1_parsing_test(BTS *the_bts,
data[5] = 0xc0;
data[5 + 57] = 1;
rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs);
+ OSMO_ASSERT(rc == 946);
OSMO_ASSERT(rlc.num_data_blocks == 2);
OSMO_ASSERT(rlc.block_info[0].e == 1);
OSMO_ASSERT(rlc.block_info[0].ti == 1);
@@ -1357,6 +1361,7 @@ static void uplink_header_type_1_parsing_test(BTS *the_bts,
data[5] = 0xc0;
data[5 + 69] = 1;
rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs);
+ OSMO_ASSERT(rc == 1138);
OSMO_ASSERT(rlc.num_data_blocks == 2);
OSMO_ASSERT(rlc.block_info[0].e == 1);
OSMO_ASSERT(rlc.block_info[0].ti == 1);
@@ -1384,6 +1389,7 @@ static void uplink_header_type_1_parsing_test(BTS *the_bts,
data[5] = 0xc0;
data[5 + 75] = 1;
rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs);
+ OSMO_ASSERT(rc == 1234);
OSMO_ASSERT(rlc.num_data_blocks == 2);
OSMO_ASSERT(rlc.block_info[0].e == 1);
OSMO_ASSERT(rlc.block_info[0].ti == 1);
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 79e49ec..7d786b4 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -2985,7 +2985,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Send 2 RLC data block */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
-
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1));
OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num()
@@ -3006,6 +3006,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Retransmit the first RLC data block with demanded_mcs */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1));
OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num()
@@ -3014,6 +3015,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Retransmit the second RLC data block with demanded_mcs */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1));
OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num()
@@ -3023,6 +3025,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Send first RLC data block BSN 0 */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num()
== mcs);
@@ -3030,6 +3033,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Send second RLC data block BSN 1 */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1));
OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num()
== mcs);
@@ -3046,6 +3050,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Send first, second RLC data blocks with demanded_mcs */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1));
OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num()
@@ -3057,6 +3062,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Send first,second RLC data blocks */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1));
OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num()
@@ -3072,6 +3078,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Send first,second RLC data blocks with demanded_mcs*/
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1));
OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num()
@@ -3084,6 +3091,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Send first RLC data block */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num()
== mcs);
@@ -3094,6 +3102,7 @@ static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts,
fn = fn_add_blocks(fn, 1);
/* Send first RLC data block with demanded_mcs */
msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts);
+ OSMO_ASSERT(msg);
OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0));
OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num()
== mcs);