From c6d4ceeda6e6b96cc5bbc07fb9489587ed181f60 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 29 Jun 2015 13:03:46 +0200 Subject: tbf/test: Add assertions These assertions check for the TBF allocation result before the tbf object is dereferenced the first time. Sponsored-by: On-Waves ehf --- tests/tbf/TbfTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 99686b9e..c9b01dbc 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -76,12 +76,14 @@ static void test_tbf_tlli_update() gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, 0, 0, 0, 0); + OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), 0, 0, 0, 0); + OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); ms = the_bts.ms_by_tlli(0x2342); -- cgit v1.2.3