aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-03-13 17:14:13 +0100
committerMax <msuraev@sysmocom.de>2019-03-19 18:27:06 +0100
commit51754b6f35d639e65385e9fdde70323037e37641 (patch)
treed0abba8e28de0267c7db6937c5a2f4e94821d956 /tests
parentd5ffeb5e63eb223852a577b8f9a3c89bf0809fb3 (diff)
MCS: move HeaderType enum outside of class definition
Move functions which compute number of blocks or bits depending on header type and corresponding enum outside of GprsCodingScheme class. This will allows us to use standard libosmocore value_sting functions in upcoming patches for IA Rest Octet encoding/decoding. Change-Id: Id0873f85e1f16a72e17e7fbc4ad76b194917067f
Diffstat (limited to 'tests')
-rw-r--r--tests/edge/EdgeTest.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp
index 9db90ca..23abada 100644
--- a/tests/edge/EdgeTest.cpp
+++ b/tests/edge/EdgeTest.cpp
@@ -71,8 +71,8 @@ static void check_coding_scheme(GprsCodingScheme& cs, GprsCodingScheme::Mode mod
OSMO_ASSERT(expected_size == cs.sizeDL());
/* Check data block sizes */
- OSMO_ASSERT(cs.maxDataBlockBytes() * cs.numDataBlocks() < cs.maxBytesDL());
- OSMO_ASSERT(cs.maxDataBlockBytes() * cs.numDataBlocks() < cs.maxBytesUL());
+ OSMO_ASSERT(cs.maxDataBlockBytes() * num_data_blocks(cs.headerTypeData()) < cs.maxBytesDL());
+ OSMO_ASSERT(cs.maxDataBlockBytes() * num_data_blocks(cs.headerTypeData()) < cs.maxBytesUL());
/* Check inc/dec */
new_cs = cs;
@@ -168,8 +168,7 @@ static void test_coding_scheme()
last_size_DL = current_cs.maxBytesDL();
/* Check header types */
- OSMO_ASSERT(current_cs.headerTypeData() ==
- GprsCodingScheme::HEADER_GPRS_DATA);
+ OSMO_ASSERT(current_cs.headerTypeData() == HEADER_GPRS_DATA);
check_coding_scheme(current_cs, GprsCodingScheme::GPRS);
}
@@ -1099,7 +1098,7 @@ static void test_rlc_unaligned_copy()
test_block[cs.maxDataBlockBytes()-1] = pattern ^ 0xff;
for (block_idx = 0;
- block_idx < cs.numDataBlocks();
+ block_idx < num_data_blocks(cs.headerTypeData());
block_idx++)
{
struct gprs_rlc_data_info rlc;