[PATCH] osmo-pcu[master]: TBF-UL: simplify test helpers

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
Thu Dec 14 11:33:34 UTC 2017


Review at  https://gerrit.osmocom.org/5337

TBF-UL: simplify test helpers

The functions to set v_r and v_q values are used only in TBF test, only
at the same time and only to set both values to 0. Replace them with
single function which does the same.

Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2
---
M src/rlc.h
M tests/tbf/TbfTest.cpp
2 files changed, 6 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/37/5337/1

diff --git a/src/rlc.h b/src/rlc.h
index 14d2082..4471092 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -341,8 +341,7 @@
 	const uint16_t v_r() const;
 	const uint16_t v_q() const;
 
-	const void set_v_r(int);
-	const void set_v_q(int);
+	void reset_v_x();
 
 	const uint16_t ssn() const;
 
@@ -574,14 +573,10 @@
 	return is_in_window(bsn) && m_v_n.is_received(bsn) && offset_v_r < ws();
 }
 
-inline const void gprs_rlc_ul_window::set_v_r(int v_r)
+inline void gprs_rlc_ul_window::reset_v_x()
 {
-	m_v_r = v_r;
-}
-
-inline const void gprs_rlc_ul_window::set_v_q(int v_q)
-{
-	m_v_q = v_q;
+	m_v_r = 0;
+	m_v_q = 0;
 }
 
 inline const uint16_t gprs_rlc_ul_window::v_r() const
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index d4b51fe..451568d 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_v_x();
 	/* 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_v_x();
 	/* 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: newchange
Gerrit-Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list