[MERGED] osmo-pcu[master]: TBF-UL: add simpler test helper

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Fri Jan 12 14:26:28 UTC 2018


Max has submitted this change and it was merged.

Change subject: TBF-UL: add simpler test helper
......................................................................


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
---
M src/rlc.h
M tests/tbf/TbfTest.cpp
2 files changed, 9 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/rlc.h b/src/rlc.h
index a7e6cf3..fcc3edb 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -342,6 +342,7 @@
 
 	const void set_v_r(int);
 	const void set_v_q(int);
+	void reset_state();
 
 	const uint16_t ssn() const;
 
@@ -573,6 +574,12 @@
 	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 40cb313..44f42b9 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -1722,8 +1722,7 @@
 		"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 @@
 
 	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;

-- 
To view, visit https://gerrit.osmocom.org/5337
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2
Gerrit-PatchSet: 7
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list