diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-30 23:04:04 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-30 23:20:03 +0200 |
commit | 08b3828995d4fcfb32dbba6a92836bf38945d03a (patch) | |
tree | 8099c7f7fb1dd626c6a42ca4524531af5dc1fe99 /tests/sms_queue | |
parent | 053e27528cf4da1f96bd5bf78c6982b73b790100 (diff) |
use osmo_init_logging2() with proper talloc ctx
Since the logging allocations now also show up in the root context report, some
tests need adjusted talloc checks.
In msc_vlr_tests, also output the number of talloc blocks before tests are
started to show that the number didn't change after the tests.
Change-Id: Iae07ae60230c7bab28e52b5df97fa3844778158e
Diffstat (limited to 'tests/sms_queue')
-rw-r--r-- | tests/sms_queue/sms_queue_test.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c index 641cc5f4f..6ce0b88b0 100644 --- a/tests/sms_queue/sms_queue_test.c +++ b/tests/sms_queue/sms_queue_test.c @@ -198,10 +198,12 @@ static struct log_info info = { int main(int argc, char **argv) { void *msgb_ctx; + void *logging_ctx; talloc_ctx = talloc_named_const(NULL, 0, "sms_queue_test"); - msgb_ctx = msgb_talloc_ctx_init(NULL, 0); - osmo_init_logging(&info); + msgb_ctx = msgb_talloc_ctx_init(talloc_ctx, 0); + logging_ctx = talloc_named_const(talloc_ctx, 0, "logging"); + osmo_init_logging2(logging_ctx, &info); OSMO_ASSERT(osmo_stderr_target); log_set_use_color(osmo_stderr_target, 0); @@ -222,6 +224,7 @@ int main(int argc, char **argv) OSMO_ASSERT(talloc_total_blocks(msgb_ctx) == 1); OSMO_ASSERT(talloc_total_size(msgb_ctx) == 0); talloc_free(msgb_ctx); + talloc_free(logging_ctx); if (talloc_total_blocks(talloc_ctx) != 1 || talloc_total_size(talloc_ctx) != 0) |