Merge remote-tracking branch 'origin/unit-test-fixes' into integration_2026_w22 (!4150)

fix a few issues with unit tests

1. fix unused argument warnings - running ninja tests fails on my system
   due to too many warnings.
2. fix google benchmark build - sometimes, when building from scratch
   the build will fail due to compiler warnings. I don't know why it
   only happens sometimes but I've instead added a warning suppression
   as this is not an issue in our code.
3. fix memory leak I've found here: !3827 (comment 224369)
4. fix running two testcases with ninja test or ctest -R. Due to them
   being dependent on dlopen they would automatically fail if the user
   environemnt was not modified manually outside cmake. I've modified
   LD_LIBRARY_PATH for those test cases, meaning you no longer need to
   run it with LD_LIBRARY_PATH=. or similar prefix.

Reviewed-By: Robert Schmidt <robert.schmidt@openairinterface.org>
This commit is contained in:
Robert Schmidt
2026-05-27 18:03:01 +02:00
37 changed files with 152 additions and 28 deletions

View File

@@ -21,6 +21,7 @@ configmodule_interface_t *uniqCfg = NULL;
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
UNUSED(assert);
printf("detected error at %s:%d:%s: %s\n", file, line, function, s);
abort();
}

View File

@@ -20,6 +20,7 @@
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
UNUSED(assert);
printf("detected error at %s:%d:%s: %s\n", file, line, function, s);
abort();
}

View File

@@ -18,12 +18,15 @@ configmodule_interface_t *uniqCfg;
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
UNUSED(assert);
LOG_E(GNB_APP, "error at %s:%d:%s: %s\n", file, line, function, s);
abort();
}
int nr_rlc_get_available_tx_space(const rnti_t rntiP, const logical_chan_id_t channel_idP)
{
UNUSED(rntiP);
UNUSED(channel_idP);
abort();
return 0;
}
@@ -144,6 +147,15 @@ static bool recv_basic_conn_qfi(protocol_ctxt_t *ctxt,
const bool rqi,
const int pdusession_id)
{
UNUSED(ctxt);
UNUSED(flag);
UNUSED(mui);
UNUSED(confirm);
UNUSED(modeP);
UNUSED(sourceL2Id);
UNUSED(destinationL2Id);
UNUSED(rqi);
UNUSED(pdusession_id);
EXPECT_EQ(ue_id, 1); // as defined in basic_conn_qfi
EXPECT_EQ(qfi, 1);
EXPECT_EQ(size, 3);
@@ -171,6 +183,14 @@ static bool recv_multi_qfi_same_pdu(protocol_ctxt_t *ctxt,
const bool rqi,
const int pdusession_id)
{
UNUSED(ctxt);
UNUSED(flag);
UNUSED(mui);
UNUSED(confirm);
UNUSED(modeP);
UNUSED(sourceL2Id);
UNUSED(destinationL2Id);
UNUSED(rqi);
EXPECT_EQ(ue_id, 7U);
EXPECT_EQ(pdusession_id, 9);
EXPECT_LT(recv_count_multi_qfi, expected_qfis_multi_qfi_count);
@@ -258,6 +278,13 @@ static bool recv_basic_conn(protocol_ctxt_t *ctxt,
const uint32_t *sourceL2Id,
const uint32_t *destinationL2Id)
{
UNUSED(srb_flagP);
UNUSED(rb_idP);
UNUSED(muiP);
UNUSED(confirmP);
UNUSED(modeP);
UNUSED(sourceL2Id);
UNUSED(destinationL2Id);
EXPECT_EQ(ctxt->rntiMaybeUEid, 12); // as defined in basic_conn
EXPECT_EQ(size, 3);
for (int i = 0; i < size; ++i)