diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-09-16 01:49:08 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-10-13 13:14:41 +0000 |
commit | 39ae17fb6945c0b4d88fa219fea1563fb9177fdc (patch) | |
tree | 6f3cadfa66d00409c09e1557c78e1ffc6061b7bc /openbsc/tests | |
parent | 4c2d4ab5db5f5703d435e6a49639fca65a049778 (diff) |
msgb ctx: use new msgb_talloc_ctx_init(), don't access talloc_msgb_ctx
Drop extern definitions of talloc_msgb_ctx and use msgb_talloc_ctx_init()
instead.
In sgsn_test.c, use a local variable msgb_ctx to do the talloc report
from the return value of msgb_talloc_ctx_init().
Change-Id: I2f9ace855f0ecbdc9adf5d75bcb1a3d666570de4
Diffstat (limited to 'openbsc/tests')
-rw-r--r-- | openbsc/tests/sgsn/sgsn_test.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 5ee5fa47b..789817c3c 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -39,8 +39,6 @@ #include <stdio.h> -extern void *tall_msgb_ctx; - void *tall_bsc_ctx; static struct sgsn_instance sgsn_inst = { .config_file = "osmo_sgsn.cfg", @@ -2423,11 +2421,12 @@ static struct log_info info = { int main(int argc, char **argv) { void *osmo_sgsn_ctx; + void *msgb_ctx; osmo_init_logging(&info); osmo_sgsn_ctx = talloc_named_const(NULL, 0, "osmo_sgsn"); tall_bsc_ctx = talloc_named_const(osmo_sgsn_ctx, 0, "bsc"); - tall_msgb_ctx = talloc_named_const(osmo_sgsn_ctx, 0, "msgb"); + msgb_ctx = msgb_talloc_ctx_init(osmo_sgsn_ctx, 0); sgsn_rate_ctr_init(); sgsn_auth_init(); @@ -2458,7 +2457,7 @@ int main(int argc, char **argv) printf("Done\n"); talloc_report_full(osmo_sgsn_ctx, stderr); - OSMO_ASSERT(talloc_total_blocks(tall_msgb_ctx) == 1); + OSMO_ASSERT(talloc_total_blocks(msgb_ctx) == 1); OSMO_ASSERT(talloc_total_blocks(tall_bsc_ctx) == 2); return 0; } |