sgsn/test: Fix msgb freeing in mocked bssgp_tx_dl_ud
Currently the mocked bssgp_tx_dl_ud function used for testing in
sgsn_test.c does not free the msg as it is done by the original
function. This leads to a msgb leak in the test.
This patch fixes the test code accordingly and uncomments the
assertion that checks for left-over msgbs.
Sponsored-by: On-Waves ehf
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index ae7a715..ebe12c9 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -53,6 +53,7 @@
struct bssgp_dl_ud_par *dup)
{
sgsn_tx_counter += 1;
+ msgb_free(msg);
return 0;
}
@@ -1463,8 +1464,7 @@
printf("Done\n");
talloc_report_full(tall_bsc_ctx, stderr);
- /* TODO: The following check currently fails */
- /* OSMO_ASSERT(talloc_total_blocks(tall_msgb_ctx) == 1); */
+ OSMO_ASSERT(talloc_total_blocks(tall_msgb_ctx) == 1);
return 0;
}