diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-07 11:31:28 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-07 11:51:07 +0200 |
commit | 14376a73a5916a3dfa5bb65a2487d364a933e4c8 (patch) | |
tree | 89ac0e40ef940dbcefba883b639d0d71d630b40e /tests/alloc/AllocTest.cpp | |
parent | 506f156f7a4aebb52dace00a760f86b2b4f5e19a (diff) |
alloc/test: Delete first TBF after the second is allocated
Currently when using the test modes TEST_MODE_DL_AFTER_UL or
TEST_MODE_UL_AFTER_DL, the first TBF is deleted before the second is
allocated. The far more interesting case were to keep the first TBF a
little bit longer until the second TBF has been created and delete
then. This comes closer the the situation observed with real MS,
where the first TBF takes some time (timeout or waiting for Ack)
before it gets deleted and thus detached from the MS object.
This commit delays the call to tbf_free accordingly.
The effect can be observed in the results of the algo A tests, where
the uniform distribution of the allocated PDCH is lost.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'tests/alloc/AllocTest.cpp')
-rw-r--r-- | tests/alloc/AllocTest.cpp | 34 |
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)"); |