Allow multiple bts objects in PCU
This patch doesn't really tests whether osmo-pcu can work on a multi-bts
environment, but it prepares the data structures to be able to do so at
any later point in time.
Change-Id: I6b10913f46c19d438c4e250a436a7446694b725a
diff --git a/tests/app_info/AppInfoTest.cpp b/tests/app_info/AppInfoTest.cpp
index e0b2853..f145fa5 100644
--- a/tests/app_info/AppInfoTest.cpp
+++ b/tests/app_info/AppInfoTest.cpp
@@ -78,7 +78,7 @@
void prepare_bts_with_two_dl_tbf_subscr()
{
- struct gprs_rlcmac_bts *bts = the_pcu->bts;
+ struct gprs_rlcmac_bts *bts = gprs_pcu_get_bts_by_nr(the_pcu, 0);
struct gprs_rlcmac_trx *trx;
fprintf(stderr, "--- %s ---\n", __func__);
@@ -121,7 +121,7 @@
void test_sched_app_info_missing_app_info_in_bts(const struct gsm_pcu_if_app_info_req *req)
{
- struct gprs_rlcmac_bts *bts = the_pcu->bts;
+ struct gprs_rlcmac_bts *bts = gprs_pcu_get_bts_by_nr(the_pcu, 0);
struct gsm_pcu_if pcu_prim = {PCU_IF_MSG_APP_INFO_REQ, };
fprintf(stderr, "--- %s ---\n", __func__);
@@ -147,13 +147,18 @@
fprintf(stderr, "\n");
}
-void cleanup()
+extern "C" void cleanup()
{
fprintf(stderr, "--- %s ---\n", __func__);
+ struct gprs_rlcmac_bts *bts;
+
tbf_free(tbf1);
tbf_free(tbf2);
- TALLOC_FREE(the_pcu->bts);
+
+ bts = gprs_pcu_get_bts_by_nr(the_pcu, 0);
+ talloc_free(bts);
+
/* FIXME: talloc report disabled, because bts_alloc_ms(bts, ) in prepare_bts_with_two_dl_tbf_subscr() causes leak */
/* talloc_report_full(tall_pcu_ctx, stderr); */
talloc_free(the_pcu);
@@ -173,7 +178,7 @@
log_parse_category_mask(osmo_stderr_target, "DL1IF,1:DRLCMAC,3:DRLCMACSCHED,1");
the_pcu = gprs_pcu_alloc(tall_pcu_ctx);
- the_pcu->bts = bts_alloc(the_pcu);
+ bts_alloc(the_pcu, 0);
test_enc_zero_len();
test_enc(&req);