aboutsummaryrefslogtreecommitdiffstats
path: root/tests/alloc/AllocTest.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-04-17 19:00:04 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-04-20 16:17:39 +0200
commit9da0686371214f0c1ce9d54596fa76380e8d820b (patch)
treef7ba2d172d23612a090c8221246b8115c64bbe48 /tests/alloc/AllocTest.cpp
parentfe7aee9302c6778494e024b77d9a870d8624a38d (diff)
Merge bts_alloc_ms() and ms_alloc()
gprs_default_cb_ms_idle() is changed to have the same implementation as previous bts_ms_idle_cb(), since that's the only one being used in osmo-pcu code. It makes no sense to use different callback logic in unit tests. This is another step towards simplifying the code and getting rid of the idle/active_cb(). Change-Id: I2a06d17588572a21dc5a14ddbde83766076b446d
Diffstat (limited to 'tests/alloc/AllocTest.cpp')
-rw-r--r--tests/alloc/AllocTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index 4497fbdd..cf1bba74 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -135,7 +135,7 @@ static void test_alloc_a(gprs_rlcmac_tbf_direction dir,
* least this part is working okay.
*/
for (i = 0; i < (int)ARRAY_SIZE(tbfs); ++i) {
- ms = bts_alloc_ms(bts);
+ ms = ms_alloc(bts);
tbfs[i] = tbf_alloc(bts, ms, dir, -1, 0);
if (tbfs[i] == NULL)
break;
@@ -155,7 +155,7 @@ static void test_alloc_a(gprs_rlcmac_tbf_direction dir,
if (tbfs[i])
tbf_free(tbfs[i]);
- ms = bts_alloc_ms(bts);
+ ms = ms_alloc(bts);
tbfs[0] = tbf_alloc(bts, ms, dir, -1, 0);
OSMO_ASSERT(tbfs[0]);
tbf_free(tbfs[0]);
@@ -221,7 +221,7 @@ static inline bool test_alloc_b_ul_dl(bool ts0, bool ts1, bool ts2, bool ts3, bo
enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7);
- ms = bts_alloc_ms(bts);
+ ms = ms_alloc(bts);
ms_set_ms_class(ms, ms_class);
/* Avoid delaying free to avoid tons of to-be-freed ms objects queuing */
ms_set_timeout(ms, 0);
@@ -264,7 +264,7 @@ static inline bool test_alloc_b_dl_ul(bool ts0, bool ts1, bool ts2, bool ts3, bo
enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7);
- ms = bts_alloc_ms(bts);
+ ms = ms_alloc(bts);
ms_set_ms_class(ms, ms_class);
/* Avoid delaying free to avoid tons of to-be-freed ms objects queuing */
ms_set_timeout(ms, 0);
@@ -315,7 +315,7 @@ static inline bool test_alloc_b_jolly(uint8_t ms_class)
tfi = bts_tfi_find_free(bts, GPRS_RLCMAC_UL_TBF, &trx_no, -1);
OSMO_ASSERT(tfi >= 0);
- ms = bts_alloc_ms(bts);
+ ms = ms_alloc(bts);
ms_set_ms_class(ms, ms_class);
/* Avoid delaying free to avoid tons of to-be-freed ms objects queuing */
ms_set_timeout(ms, 0);
@@ -561,7 +561,7 @@ static unsigned alloc_many_tbfs(struct gprs_rlcmac_bts *bts, unsigned min_class,
ms = bts_get_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI);
if (!ms)
- ms = bts_alloc_ms(bts);
+ ms = ms_alloc(bts);
ms_set_ms_class(ms, ms_class);
ms = alloc_tbfs(bts, ms, mode);
if (!ms)
@@ -770,7 +770,7 @@ static void test_2_consecutive_dl_tbfs()
trx->pdch[6].enable();
trx->pdch[7].enable();
- ms = bts_alloc_ms(bts);
+ ms = ms_alloc(bts);
ms_set_ms_class(ms, ms_class);
ms_set_egprs_ms_class(ms, egprs_ms_class);
dl_tbf1 = dl_tbf_alloc(bts, ms, 0, false);
@@ -783,7 +783,7 @@ static void test_2_consecutive_dl_tbfs()
OSMO_ASSERT(numTs1 == 4);
printf("TBF1: numTs(%d)\n", numTs1);
- ms = bts_alloc_ms(bts);
+ ms = ms_alloc(bts);
ms_set_ms_class(ms, ms_class);
ms_set_egprs_ms_class(ms, egprs_ms_class);
dl_tbf2 = dl_tbf_alloc(bts, ms, 0, false);