From ccde5c9557382f56a40e0c94fc29eca8bd886c1c Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Sat, 4 Feb 2017 03:10:08 +0100 Subject: remove pcu own bitvector implementation The osmocore bitvec is exact the same, but use a pointer instead of a reference. Change-Id: Id8f797631d89aa12b6e48efb2dc153a3e2f059f7 --- tests/rlcmac/RLCMACTest.cpp | 24 +++++++++++++----------- tests/tbf/TbfTest.cpp | 4 ++-- tests/types/TypesTest.cpp | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) (limited to 'tests') diff --git a/tests/rlcmac/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp index 97e5e606..9155809c 100644 --- a/tests/rlcmac/RLCMACTest.cpp +++ b/tests/rlcmac/RLCMACTest.cpp @@ -83,9 +83,9 @@ void printSizeofRLCMAC() cout << "sizeof PSI5_t " << sizeof(PSI5_t) << endl; } -void testRlcMacDownlink() +void testRlcMacDownlink(void *test_ctx) { - struct bitvec *resultVector = bitvec_alloc(23); + struct bitvec *resultVector = bitvec_alloc(23, test_ctx); bitvec_unhex(resultVector, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); std::string testData[] = { @@ -106,7 +106,7 @@ void testRlcMacDownlink() cout << " DOWNLINK " << endl; for (int i = 0; i < testDataSize; i++) { - bitvec *vector = bitvec_alloc(23); + bitvec *vector = bitvec_alloc(23, test_ctx); bitvec_unhex(vector, testData[i].c_str()); cout << "vector1 = "; for (int i = 0; i < 23; i++) @@ -150,9 +150,9 @@ void testRlcMacDownlink() } -void testRlcMacUplink() +void testRlcMacUplink(void *test_ctx) { - struct bitvec *resultVector = bitvec_alloc(23); + struct bitvec *resultVector = bitvec_alloc(23, test_ctx); bitvec_unhex(resultVector, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); std::string testData[] = { @@ -169,7 +169,7 @@ void testRlcMacUplink() cout << " UPLINK " << endl; for (int i = 0; i < testDataSize; i++) { - bitvec *vector = bitvec_alloc(23); + bitvec *vector = bitvec_alloc(23, test_ctx); bitvec_unhex(vector, testData[i].c_str()); cout << "vector1 = "; for (int i = 0; i < 23; i++) @@ -212,9 +212,9 @@ void testRlcMacUplink() bitvec_free(resultVector); } -void testCsnLeftAlignedVarBmpBounds() +void testCsnLeftAlignedVarBmpBounds(void *test_ctx) { - bitvec *vector = bitvec_alloc(23); + bitvec *vector = bitvec_alloc(23, test_ctx); bitvec_unhex(vector, "40200bffd161003e0e519ffffffb800000000000000000"); RlcMacUplink_t data; @@ -229,10 +229,12 @@ void testCsnLeftAlignedVarBmpBounds() int main(int argc, char *argv[]) { + void *ctx = talloc_named_const(NULL, 1, "RLCMACTest"); osmo_init_logging(&gprs_log_info); //printSizeofRLCMAC(); - testRlcMacDownlink(); - testRlcMacUplink(); - testCsnLeftAlignedVarBmpBounds(); + testRlcMacDownlink(ctx); + testRlcMacUplink(ctx); + testCsnLeftAlignedVarBmpBounds(ctx); + talloc_free(ctx); } diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 00aa4a81..496437d2 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -595,7 +595,7 @@ static void send_ul_mac_block(BTS *the_bts, unsigned trx_no, unsigned ts_no, meas.set_rssi(31); - rlc_block = bitvec_alloc(23); + rlc_block = bitvec_alloc(23, tall_pcu_ctx); encode_gsm_rlcmac_uplink(rlc_block, ulreq); num_bytes = bitvec_pack(rlc_block, &buf[0]); @@ -2555,7 +2555,7 @@ static void test_tbf_epdan_out_of_rx_window(void) OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FLOW)); - block = bitvec_alloc(23); + block = bitvec_alloc(23, tall_pcu_ctx); bitvec_unpack(block, data_msg); diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index ee1c817c..7d091085 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -430,7 +430,7 @@ static void test_rlc_dl_ul_basic() void test_immediate_assign_rej() { uint8_t plen; - bitvec *immediate_assignment_rej = bitvec_alloc(22); + bitvec *immediate_assignment_rej = bitvec_alloc(22, tall_pcu_ctx); bitvec_unhex(immediate_assignment_rej, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); -- cgit v1.2.3