aboutsummaryrefslogtreecommitdiffstats
path: root/tests/handover/handover_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/handover/handover_test.c')
-rw-r--r--tests/handover/handover_test.c12
1 files changed, 9 insertions, 3 deletions
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;
}