diff options
Diffstat (limited to 'tests/alloc/MslotTest.cpp')
-rw-r--r-- | tests/alloc/MslotTest.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp index e3546410..b32a828a 100644 --- a/tests/alloc/MslotTest.cpp +++ b/tests/alloc/MslotTest.cpp @@ -62,15 +62,12 @@ static inline void test_all_classes(struct gprs_rlcmac_trx *trx, bool clear_mask static inline void test_multislot_total_ascending(bool seq) { - BTS the_bts(the_pcu); - struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu); struct gprs_rlcmac_trx *trx; int i; printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); - bts = the_bts.bts_data(); - trx = &bts->trx[0]; for (i = 0; i < 8; i++) { @@ -79,19 +76,17 @@ static inline void test_multislot_total_ascending(bool seq) test_all_classes(trx, seq); } + talloc_free(bts); } static inline void test_multislot_total_descending(bool seq) { - BTS the_bts(the_pcu); - struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu); struct gprs_rlcmac_trx *trx; int i; printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); - bts = the_bts.bts_data(); - trx = &bts->trx[0]; for (i = 7; i >= 0; i--) { @@ -100,18 +95,16 @@ static inline void test_multislot_total_descending(bool seq) test_all_classes(trx, seq); } + talloc_free(bts); } static inline void test_multislot_middle(bool seq) { - BTS the_bts(the_pcu); - struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu); struct gprs_rlcmac_trx *trx; printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); - bts = the_bts.bts_data(); - trx = &bts->trx[0]; trx->pdch[2].enable(); @@ -119,24 +112,23 @@ static inline void test_multislot_middle(bool seq) trx->pdch[4].enable(); test_all_classes(trx, seq); + talloc_free(bts); } static inline void test_multislot_ends(bool seq) { - BTS the_bts(the_pcu); - struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu); struct gprs_rlcmac_trx *trx; printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); - bts = the_bts.bts_data(); - trx = &bts->trx[0]; trx->pdch[0].enable(); trx->pdch[7].enable(); test_all_classes(trx, seq); + talloc_free(bts); } static inline void test_window_wrapper() |