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
This commit is contained in:
parent
96262a7ca6
commit
6c766c6464
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
full talloc report on 'null_context' (total 0 bytes in 1 blocks)
|
Loading…
Reference in New Issue