Change in osmo-msc[master]: tests/sms_queue: track the use of NULL talloc memory contexts

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sat Mar 30 09:09:38 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13469


Change subject: tests/sms_queue: track the use of NULL talloc memory contexts
......................................................................

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
---
M tests/sms_queue/sms_queue_test.c
M tests/sms_queue/sms_queue_test.err
2 files changed, 7 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/69/13469/1

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 @@
 	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 @@
 	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)

-- 
To view, visit https://gerrit.osmocom.org/13469
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I99fd82750aff376e4d90eaa2402ec41f4d59ef86
Gerrit-Change-Number: 13469
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190330/81d71752/attachment.htm>


More information about the gerrit-log mailing list