aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2017-02-04 03:10:08 +0100
committerHarald Welte <laforge@gnumonks.org>2017-05-15 12:46:33 +0000
commitccde5c9557382f56a40e0c94fc29eca8bd886c1c (patch)
treee95b2f38979060d05161d7b5f0470a2e8b233669 /tests
parent3de6d0602f4c0c70b87d303161e154746a74b50d (diff)
remove pcu own bitvector implementation
The osmocore bitvec is exact the same, but use a pointer instead of a reference. Change-Id: Id8f797631d89aa12b6e48efb2dc153a3e2f059f7
Diffstat (limited to 'tests')
-rw-r--r--tests/rlcmac/RLCMACTest.cpp24
-rw-r--r--tests/tbf/TbfTest.cpp4
-rw-r--r--tests/types/TypesTest.cpp2
3 files changed, 16 insertions, 14 deletions
diff --git a/tests/rlcmac/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp
index 97e5e60..9155809 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 00aa4a8..496437d 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 ee1c817..7d09108 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");