From 6e9f9c20e94e09fad5fa96ee233476b3ff16b045 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 11 Jan 2016 11:15:45 +0100 Subject: edge: Add init functions for gprs_rlc_data_info Add the functions gprs_rlc_data_info_init_dl/ul which initialise a gprs_rlc_data_info structure depending on the coding scheme. The fields num_data_blocks, data_offs_bits, cs, and the data_blocks are valid after this call. The other fields are set to 0. The data blocks are initialised to the correct data_len, e == 1 (no extension header field), cv == 15 (not a final block). The other data block fields are set to 0. The gprs_rlc_data_block_info can also be initialised separately by using the gprs_rlc_data_block_info_init function. Sponsored-by: On-Waves ehf --- tests/edge/EdgeTest.cpp | 18 ++++++++++++++++++ tests/edge/EdgeTest.ok | 2 ++ 2 files changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index b26262ca..7bb81e47 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -481,6 +481,23 @@ static void test_rlc_unit_decoder() printf("=== end %s ===\n", __func__); } +static void test_rlc_info_init() +{ + struct gprs_rlc_data_info rlc; + + printf("=== start %s ===\n", __func__); + gprs_rlc_data_info_init_dl(&rlc, GprsCodingScheme(GprsCodingScheme::CS1)); + OSMO_ASSERT(rlc.num_data_blocks == 1); + OSMO_ASSERT(rlc.data_offs_bits[0] == 24); + OSMO_ASSERT(rlc.block_info[0].data_len == 20); + + gprs_rlc_data_info_init_dl(&rlc, GprsCodingScheme(GprsCodingScheme::MCS1)); + OSMO_ASSERT(rlc.num_data_blocks == 1); + OSMO_ASSERT(rlc.data_offs_bits[0] == 33); + OSMO_ASSERT(rlc.block_info[0].data_len == 22); + + printf("=== end %s ===\n", __func__); +} static const struct log_info_cat default_categories[] = { {"DCSN1", "\033[1;31m", "Concrete Syntax Notation One (CSN1)", LOGL_INFO, 0}, @@ -525,6 +542,7 @@ int main(int argc, char **argv) pcu_vty_init(&debug_log_info); test_coding_scheme(); + test_rlc_info_init(); test_rlc_unit_decoder(); if (getenv("TALLOC_REPORT_FULL")) diff --git a/tests/edge/EdgeTest.ok b/tests/edge/EdgeTest.ok index 791f0d5e..95ec2b3a 100644 --- a/tests/edge/EdgeTest.ok +++ b/tests/edge/EdgeTest.ok @@ -1,4 +1,6 @@ === start test_coding_scheme === === end test_coding_scheme === +=== start test_rlc_info_init === +=== end test_rlc_info_init === === start test_rlc_unit_decoder === === end test_rlc_unit_decoder === -- cgit v1.2.3