remove pcu own bitvector implementation
The osmocore bitvec is exact the same, but use a pointer instead of
a reference.
Change-Id: Id8f797631d89aa12b6e48efb2dc153a3e2f059f7
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 @@
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 @@
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 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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");