aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/abis/abis_test.c2
-rw-r--r--tests/bsc/bsc_test.c8
-rw-r--r--tests/channel/channel_test.c2
-rw-r--r--tests/gsm0408/gsm0408_test.c4
-rw-r--r--tests/handover/handover_test.c12
-rw-r--r--tests/nanobts_omlattr/nanobts_omlattr_test.c1
6 files changed, 21 insertions, 8 deletions
diff --git a/tests/abis/abis_test.c b/tests/abis/abis_test.c
index 6369b0701..0e296f58a 100644
--- a/tests/abis/abis_test.c
+++ b/tests/abis/abis_test.c
@@ -179,7 +179,7 @@ static const struct log_info log_info = {
int main(int argc, char **argv)
{
- osmo_init_logging(&log_info);
+ osmo_init_logging2(&log_info, NULL);
test_sw_selection();
test_abis_nm_ipaccess_cgi();
diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 541a44caf..298dc6069 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -39,6 +39,8 @@
#include <stdio.h>
#include <search.h>
+void *ctx = NULL;
+
enum test {
TEST_SCAN_TO_BTS,
TEST_SCAN_TO_MSC,
@@ -122,7 +124,7 @@ static void test_scan(void)
{
int i;
- struct gsm_network *net = bsc_network_init(NULL);
+ struct gsm_network *net = bsc_network_init(ctx);
struct gsm_bts *bts = gsm_bts_alloc(net, 0);
struct bsc_msc_data *msc;
struct gsm_subscriber_connection *conn;
@@ -227,11 +229,13 @@ static const struct log_info log_info = {
int main(int argc, char **argv)
{
- msgb_talloc_ctx_init(NULL, 0);
+ ctx = talloc_named_const(NULL, 0, "bsc-test");
+ msgb_talloc_ctx_init(ctx, 0);
osmo_init_logging(&log_info);
test_scan();
printf("Testing execution completed.\n");
+ talloc_free(ctx);
return 0;
}
diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c
index b41e3d6a7..186f3bd37 100644
--- a/tests/channel/channel_test.c
+++ b/tests/channel/channel_test.c
@@ -98,7 +98,7 @@ static const struct log_info log_info = {
int main(int argc, char **argv)
{
- osmo_init_logging(&log_info);
+ osmo_init_logging2(&log_info, NULL);
test_dyn_ts_subslots();
test_bts_debug_print();
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index 9f5a5c41f..3957bfb32 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -831,7 +831,9 @@ int main(int argc, char **argv)
{
struct gsm_network *net;
- osmo_init_logging(&log_info);
+ tall_bsc_ctx = talloc_named_const(NULL, 0, "gsm0408_test");
+
+ osmo_init_logging2(&log_info, tall_bsc_ctx);
log_set_log_level(osmo_stderr_target, LOGL_INFO);
net = bsc_network_init(tall_bsc_ctx);
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 8ba97fd8e..ca2e409c0 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -40,6 +40,8 @@
#include <osmocom/bsc/bsc_api.h>
#include <osmocom/bsc/osmo_bsc.h>
+void *ctx;
+
struct gsm_network *bsc_gsmnet;
/* measurement report */
@@ -161,7 +163,7 @@ static struct gsm_bts *create_bts(int arfcn)
bts->codec.hr = 1;
bts->codec.amr = 1;
- rsl_link = talloc_zero(0, struct e1inp_sign_link);
+ rsl_link = talloc_zero(ctx, struct e1inp_sign_link);
rsl_link->trx = bts->c0;
bts->c0->rsl_link = rsl_link;
@@ -1274,6 +1276,9 @@ int main(int argc, char **argv)
int test_case_i;
int last_test_i;
+ ctx = talloc_named_const(NULL, 0, "handover_test");
+ msgb_talloc_ctx_init(ctx, 0);
+
test_case_i = argc > 1? atoi(argv[1]) : -1;
last_test_i = ARRAY_SIZE(test_cases) - 1;
@@ -1286,14 +1291,14 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
- osmo_init_logging(&log_info);
+ osmo_init_logging2(&log_info, ctx);
log_set_print_category(osmo_stderr_target, 1);
log_set_print_category_hex(osmo_stderr_target, 0);
log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME);
/* Create a dummy network */
- bsc_gsmnet = bsc_network_init(NULL);
+ bsc_gsmnet = bsc_network_init(ctx);
if (!bsc_gsmnet)
exit(1);
@@ -1600,6 +1605,7 @@ int main(int argc, char **argv)
fprintf(stderr, "--------------------\n");
+ talloc_free(ctx);
return EXIT_SUCCESS;
}
diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c
index 0554f4393..2cde892bd 100644
--- a/tests/nanobts_omlattr/nanobts_omlattr_test.c
+++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c
@@ -284,6 +284,7 @@ int main(int argc, char **argv)
talloc_free(trx);
talloc_report_full(ctx, stderr);
OSMO_ASSERT(talloc_total_blocks(ctx) == 1);
+ talloc_free(ctx);
return 0;
}