diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-16 15:01:38 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-16 19:24:16 +0200 |
commit | 88fb6136fb8b69f37ded4c868689556f3bde3ac8 (patch) | |
tree | 5a7b2b8827ba8d36bd396a11b4da2f2a2842dba7 | |
parent | e21b79cb211fa930b79b69ce9416a25816daff47 (diff) |
alloc/test: Show expectation before failure
To simplify debugging, show the actuals value before the assertion
fails in some cases.
Sponsored-by: On-Waves ehf
-rw-r--r-- | tests/alloc/AllocTest.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index ec75078b..021f870d 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -641,6 +641,9 @@ static void test_successive_allocation(algo_t algo, unsigned min_class, counter = alloc_many_tbfs(&the_bts, min_class, max_class, mode); printf(" Successfully allocated %d UL TBFs\n", counter); + if (counter != expect_num) + fprintf(stderr, " Expected %d TBFs for %s\n", expect_num, text); + OSMO_ASSERT(counter == expect_num); check_tfi_usage(&the_bts); @@ -684,13 +687,19 @@ static void test_many_connections(algo_t algo, unsigned expect_num, if (mode_seq[i] == TEST_MODE_UL_ONLY) continue; - if (counter2 >= 0) + if (counter2 >= 0) { + if (counter1 < counter2) + fprintf(stderr, " Expected %d >= %d in %s\n", + counter1, counter2, text); OSMO_ASSERT(counter1 >= counter2); + } counter2 = counter1; } printf(" Successfully allocated %d TBFs\n", counter1); + if (counter1 != (int)expect_num) + fprintf(stderr, " Expected %d TBFs for %s\n", expect_num, text); OSMO_ASSERT(expect_num == (unsigned)counter1); } |