aboutsummaryrefslogtreecommitdiffstats
path: root/tests/alloc/AllocTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/alloc/AllocTest.cpp')
-rw-r--r--tests/alloc/AllocTest.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index 35bbfc4d..b5d4b954 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -11,10 +11,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "gprs_rlcmac.h"
@@ -152,6 +148,8 @@ static void test_alloc_a(gprs_rlcmac_tbf_direction dir,
OSMO_ASSERT(i == count);
+ OSMO_ASSERT(bts_all_pdch_allocated(bts));
+
for (i = 0; i < count; ++i)
if (tbfs[i])
tbf_free(tbfs[i]);
@@ -479,6 +477,7 @@ static GprsMs *alloc_tbfs(struct gprs_rlcmac_bts *bts, struct GprsMs *old_ms, en
tbf_free(ms_ul_tbf(old_ms));
tbf = tbf_alloc_ul_tbf(bts, old_ms, trx_no, false);
if (tbf == NULL) {
+ OSMO_ASSERT(trx_no != -1 || bts_all_pdch_allocated(bts));
ms_unref(old_ms);
return NULL;
}
@@ -490,6 +489,7 @@ static GprsMs *alloc_tbfs(struct gprs_rlcmac_bts *bts, struct GprsMs *old_ms, en
tbf_free(ms_dl_tbf(old_ms));
tbf = tbf_alloc_dl_tbf(bts, old_ms, trx_no, false);
if (tbf == NULL) {
+ OSMO_ASSERT(trx_no != -1 || bts_all_pdch_allocated(bts));
ms_unref(old_ms);
return NULL;
}
@@ -806,15 +806,22 @@ static void test_2_consecutive_dl_tbfs()
static void test_bts_pch_timer(void)
{
struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu, 0);
- const char *imsi1 = "1234";
- const char *imsi2 = "5678";
+ struct osmo_mobile_identity mi_imsi1, mi_imsi2;
+ struct osmo_mobile_identity mi_tmsi1;
+ mi_imsi1.type = mi_imsi2.type = GSM_MI_TYPE_IMSI;
+ mi_tmsi1.type = GSM_MI_TYPE_TMSI;
+ OSMO_STRLCPY_ARRAY(mi_imsi1.imsi, "1234");
+ OSMO_STRLCPY_ARRAY(mi_imsi2.imsi, "5678");
+ mi_tmsi1.tmsi = 987654321;
fprintf(stderr, "Testing bts_pch_timer dealloc on bts dealloc\n");
log_set_category_filter(osmo_stderr_target, DPCU, 1, LOGL_DEBUG);
fprintf(stderr, "Starting PCH timer for 2 IMSI\n");
- bts_pch_timer_start(bts, imsi1);
- bts_pch_timer_start(bts, imsi2);
+ bts_pch_timer_start(bts, &mi_imsi1, mi_imsi1.imsi);
+ bts_pch_timer_start(bts, &mi_imsi2, mi_imsi2.imsi);
+ fprintf(stderr, "Starting PCH timer for 1 TMSI\n");
+ bts_pch_timer_start(bts, &mi_tmsi1, "6666");
fprintf(stderr, "Deallocating BTS, expecting the PCH timer to be stopped and deallocated\n");
talloc_free(bts);