aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-03-30 15:31:47 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-04-01 12:02:57 +0000
commit6c766c6464e6f84ee971788183eb122b3e6cc4df (patch)
tree81f3c20e4f47418de7dffd22b3b606ee69285e67
parent96262a7ca67115482cfb89f9954413638b1d5dcc (diff)
tests/sms_queue: track the use of NULL talloc memory contexts
As we don't initialize all talloc contects of libmsc, let's make sure that there is nothing left in the NULL context after the unit test execution is finished. Change-Id: I99fd82750aff376e4d90eaa2402ec41f4d59ef86
-rw-r--r--tests/sms_queue/sms_queue_test.c6
-rw-r--r--tests/sms_queue/sms_queue_test.err1
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c
index f64f715..84ca6b5 100644
--- a/tests/sms_queue/sms_queue_test.c
+++ b/tests/sms_queue/sms_queue_test.c
@@ -220,6 +220,9 @@ int main(int argc, char **argv)
void *msgb_ctx;
void *logging_ctx;
+ /* Track the use of talloc NULL memory contexts */
+ talloc_enable_null_tracking();
+
talloc_ctx = talloc_named_const(NULL, 0, "sms_queue_test");
msgb_ctx = msgb_talloc_ctx_init(talloc_ctx, 0);
logging_ctx = talloc_named_const(talloc_ctx, 0, "logging");
@@ -258,6 +261,9 @@ int main(int argc, char **argv)
OSMO_ASSERT(talloc_total_size(talloc_ctx) == 0);
talloc_free(talloc_ctx);
+ talloc_report_full(NULL, stderr);
+ talloc_disable_null_tracking();
+
return 0;
}
diff --git a/tests/sms_queue/sms_queue_test.err b/tests/sms_queue/sms_queue_test.err
index e69de29..bfc1aff 100644
--- a/tests/sms_queue/sms_queue_test.err
+++ b/tests/sms_queue/sms_queue_test.err
@@ -0,0 +1 @@
+full talloc report on 'null_context' (total 0 bytes in 1 blocks)