aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tbf/TbfTest.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-29 14:18:46 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-07-03 13:17:22 +0200
commitac89a555fa73b24a77bb861811774a5af885bc84 (patch)
treed0edad2d9003d7355f5637e61aa4f8f2f73879f8 /tests/tbf/TbfTest.cpp
parent699b8dca49df30b7bf6db7090eb416d1ad4fd46d (diff)
ms: Add tbf() method to get the TBF based on the direction
To avoid the need for a switch or conditional statement when needing a TBF from an MS object in direction independant code, this method contains that case distinction. For additional flexibility, a reverse() function is added to get the opposite direction. Sponsored-by: On-Waves ehf
Diffstat (limited to 'tests/tbf/TbfTest.cpp')
-rw-r--r--tests/tbf/TbfTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index c9b01dbc..47c090a0 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -61,6 +61,17 @@ static unsigned inc_fn(fn)
}
*/
+static void test_tbf_base()
+{
+
+ printf("=== start %s ===\n", __func__);
+
+ OSMO_ASSERT(GPRS_RLCMAC_DL_TBF == reverse(GPRS_RLCMAC_UL_TBF));
+ OSMO_ASSERT(GPRS_RLCMAC_UL_TBF == reverse(GPRS_RLCMAC_DL_TBF));
+
+ printf("=== end %s ===\n", __func__);
+}
+
static void test_tbf_tlli_update()
{
BTS the_bts;
@@ -667,6 +678,7 @@ int main(int argc, char **argv)
vty_init(&pcu_vty_info);
pcu_vty_init(&debug_log_info);
+ test_tbf_base();
test_tbf_tlli_update();
test_tbf_final_ack(TEST_MODE_STANDARD);
test_tbf_final_ack(TEST_MODE_REVERSE_FREE);