Fix memory leak in unit tests

This commit is contained in:
Bartosz Podrygajlo
2026-04-04 17:30:16 +02:00
parent 46c120651f
commit 9ef4efe10a
2 changed files with 8 additions and 4 deletions

View File

@@ -691,9 +691,11 @@ TEST(test_srs_power, tpc_accumulation)
int main(int argc, char** argv)
{
logInit();
load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
configmodule_interface_t *uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
g_log->log_component[MAC].level = OAILOG_DEBUG;
g_log->log_component[NR_MAC].level = OAILOG_DEBUG;
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
int ret = RUN_ALL_TESTS();
end_configmodule(uniqCfg);
return ret;
}

View File

@@ -171,9 +171,11 @@ TEST(test_init_ra, four_step_cfra)
int main(int argc, char **argv)
{
logInit();
load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
configmodule_interface_t *uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
g_log->log_component[MAC].level = OAILOG_DEBUG;
g_log->log_component[NR_MAC].level = OAILOG_DEBUG;
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
int ret = RUN_ALL_TESTS();
end_configmodule(uniqCfg);
return ret;
}