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
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index ac67ce9..429f588 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -633,7 +633,8 @@
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;