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.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index 874f9070..bf93f579 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -461,34 +461,36 @@ static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class,
GprsMs::Guard guard(ms);
- /* Optionally delete the TBF */
- switch (mode) {
- case TEST_MODE_DL_AFTER_UL:
- case TEST_MODE_UL_AFTER_DL:
- tbf_free(tbf);
- break;
-
- default:
- break;
- }
-
/* Continue with what is needed next */
switch (mode) {
case TEST_MODE_UL_ONLY:
case TEST_MODE_DL_ONLY:
/* We are done */
- return ms;
+ break;
case TEST_MODE_DL_AFTER_UL:
case TEST_MODE_UL_AND_DL:
- return alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_DL_ONLY);
+ ms = alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_DL_ONLY);
+ break;
case TEST_MODE_UL_AFTER_DL:
case TEST_MODE_DL_AND_UL:
- return alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_UL_ONLY);
+ ms = alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_UL_ONLY);
+ break;
+ }
+
+ /* Optionally delete the TBF */
+ switch (mode) {
+ case TEST_MODE_DL_AFTER_UL:
+ case TEST_MODE_UL_AFTER_DL:
+ tbf_free(tbf);
+ break;
+
+ default:
+ break;
}
- return NULL;
+ return ms;
}
static void test_successive_allocation(algo_t algo, unsigned min_class,
@@ -584,7 +586,7 @@ static void test_successive_allocation()
32, "algorithm B class 10 (DL after UL)");
test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL,
- 32, "algorithm A (UL after DL)");
+ 7, "algorithm A (UL after DL)");
test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL,
32, "algorithm B class 10 (UL after DL)");