From 7b3675bf7a6203467e6a72e255544365cefc3b06 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 16 Jul 2015 18:28:22 +0200 Subject: alloc/test: Fix trx_no assertion Currently the value of trx_no2 is used in the assertion, even if the call to tfi_find_free has failed. This commit fixes the asserted expression to only compare the trx_no values if the function call has succeeded. Sponsored-by: On-Waves ehf --- tests/alloc/AllocTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index ac67ce95..429f588a 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -633,7 +633,8 @@ static unsigned alloc_many_tbfs(BTS *the_bts, unsigned min_class, tfi2 = the_bts->tfi_find_free(dir, &trx_no2, ms->current_trx()->trx_no); OSMO_ASSERT(tfi != tfi2); - OSMO_ASSERT(trx_no2 == ms->current_trx()->trx_no); + OSMO_ASSERT(tfi2 < 0 || + trx_no2 == ms->current_trx()->trx_no); } ms_class += 1; -- cgit v1.2.3