diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-01-13 11:56:28 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-18 13:17:09 +0100 |
commit | f0b06d82cd6f2a340db052a2fa2e559aa75f1fa8 (patch) | |
tree | ceda78f3596c1f7c1621ef36d63d4a97ccf89ddd /openbsc/tests/sgsn/sgsn_test.c | |
parent | 07de92e2c0ccfa89b9498c8c49a74d0848b7b85a (diff) |
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
Diffstat (limited to 'openbsc/tests/sgsn/sgsn_test.c')
-rw-r--r-- | openbsc/tests/sgsn/sgsn_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index ae7a715e2..ebe12c906 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -53,6 +53,7 @@ int bssgp_tx_dl_ud(struct msgb *msg, uint16_t pdu_lifetime, struct bssgp_dl_ud_par *dup) { sgsn_tx_counter += 1; + msgb_free(msg); return 0; } @@ -1463,8 +1464,7 @@ int main(int argc, char **argv) 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; } |