diff options
author | Max <msuraev@sysmocom.de> | 2017-12-15 11:08:58 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2018-01-12 14:26:28 +0000 |
commit | 2617bf201661fca909774aa44d8ee017e5225ab1 (patch) | |
tree | ecc7217327459e0c9bf8eff0028f06e432177b00 | |
parent | 58818585bc99dc4aaaf94fec4ffeedf211a7b209 (diff) |
TBF-UL: add simpler test helper
Add function to set both V_R and V_Q values to 0 which is useful for TBF
test.
Related: OS#1759
Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2
-rw-r--r-- | src/rlc.h | 7 | ||||
-rw-r--r-- | tests/tbf/TbfTest.cpp | 6 |
2 files changed, 9 insertions, 4 deletions
@@ -342,6 +342,7 @@ struct gprs_rlc_ul_window: public gprs_rlc_window { const void set_v_r(int); const void set_v_q(int); + void reset_state(); const uint16_t ssn() const; @@ -573,6 +574,12 @@ inline bool gprs_rlc_ul_window::is_received(uint16_t bsn) const return is_in_window(bsn) && m_v_n.is_received(bsn) && offset_v_r < ws(); } +inline void gprs_rlc_ul_window::reset_state() +{ + m_v_r = 0; + m_v_q = 0; +} + inline const void gprs_rlc_ul_window::set_v_r(int v_r) { m_v_r = v_r; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 40cb3136..44f42b9b 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1722,8 +1722,7 @@ static void test_tbf_egprs_two_phase_puan(void) "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.set_v_r(0); - ul_tbf->m_window.set_v_q(0); + ul_tbf->m_window.reset_state(); /* Function to generate URBB with length */ ul_tbf = establish_ul_tbf_two_phase_puan_URBB_with_length(&the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class, ul_tbf); @@ -1735,8 +1734,7 @@ static void test_tbf_egprs_two_phase_puan(void) send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.set_v_r(0); - ul_tbf->m_window.set_v_q(0); + ul_tbf->m_window.reset_state(); /* Function to generate CRBB */ bts->ws_base = 128; bts->ws_pdch = 64; |