Change in osmo-ttcn3-hacks[master]: PCU_Tests: fix readability of code using t_RLCMAC_UL_DATA_TLLI

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Mon Oct 19 18:02:15 UTC 2020


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20702 )

Change subject: PCU_Tests: fix readability of code using t_RLCMAC_UL_DATA_TLLI
......................................................................

PCU_Tests: fix readability of code using t_RLCMAC_UL_DATA_TLLI

Change-Id: I175f8ce2606050c6b4ea54eae4e00846291d462f
---
M pcu/PCU_Tests.ttcn
1 file changed, 22 insertions(+), 15 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index a6f052e..ea3e6ba 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -901,6 +901,8 @@
 	var uint32_t dl_fn, sched_fn;
 	var octetstring payload;
 	var template (value) RlcmacUlBlock ul_data;
+	var template (value) LlcBlockHdr blk_hdr;
+	var template (value) LlcBlocks blocks;
 	var GprsMS ms;
 
 	/* Initialize NS/BSSGP side */
@@ -922,14 +924,15 @@
 	/* Send one UL block (with TLLI since we are in One-Phase Access
 	   contention resoultion) and make sure it is ACKED fine. */
 	payload := f_rnd_octstring(16); /* 16 bytes fills the llc block (because TLLI takes 4 bytes) */
+	blk_hdr := t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload),
+					 more := false, e := true);
+	blocks := { t_RLCMAC_LLCBLOCK(payload, blk_hdr) };
 	/* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */
 	ul_data := t_RLCMAC_UL_DATA_TLLI(tfi := ms.ul_tbf.tfi,
-				    cv := 15,
-				    bsn := ms.ul_tbf.bsn,
-				    blocks := { t_RLCMAC_LLCBLOCK(payload,
-								  t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload), more := false, e := true))
-					      },
-				    tlli := ms.tlli);
+					 cv := 15,
+					 bsn := ms.ul_tbf.bsn,
+					 blocks := blocks,
+					 tlli := ms.tlli);
 	f_ultbf_inc_bsn(ms.ul_tbf);
 	f_ms_tx_ul_block(ms, ul_data);
 
@@ -953,13 +956,14 @@
 		}
 
 		payload := f_rnd_octstring(i);
+		blk_hdr := t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload),
+						 more := false, e := true);
+		blocks := { t_RLCMAC_LLCBLOCK(payload, blk_hdr) };
 		/* Set CV = 15 to signal there's still more than BS_CV_MAX blocks to be sent */
 		ul_data := t_RLCMAC_UL_DATA(tfi := ms.ul_tbf.tfi,
 					    cv := cv,
 					    bsn := ms.ul_tbf.bsn,
-					    blocks := { t_RLCMAC_LLCBLOCK(payload,
-									  t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload), more := false, e := true))
-						      });
+					    blocks := blocks);
 		f_ultbf_inc_bsn(ms.ul_tbf);
 		f_ms_tx_ul_block(ms, ul_data);
 
@@ -989,6 +993,8 @@
 function f_TC_ul_data_toolong_fills_padding_cs(inout GprsMS ms, CodingScheme cs, integer cv) runs on RAW_PCU_Test_CT {
 	var octetstring payload;
 	var template (value) RlcmacUlBlock ul_data;
+	var template (value) LlcBlockHdr blk_hdr;
+	var template (value) LlcBlocks blocks;
 	var integer block_len, max_valid_data_len;
 	timer T;
 
@@ -998,13 +1004,14 @@
 	 * indicator, -1 for spare bits octet at the end */
 	max_valid_data_len := block_len - 4 - 3 - 1 - 1;
 	payload := f_rnd_octstring(max_valid_data_len + 1); /* +1 to write LLC data on last padding octet */
+	blk_hdr := t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload),
+					 more := false, e := true);
+	blocks := { t_RLCMAC_LLCBLOCK(payload, blk_hdr) };
 	ul_data := t_RLCMAC_UL_DATA_TLLI(tfi := ms.ul_tbf.tfi,
-				    cv := cv,
-				    bsn := ms.ul_tbf.bsn,
-				    blocks := { t_RLCMAC_LLCBLOCK(payload,
-								  t_RLCMAC_LLCBLOCK_HDR(length_ind := lengthof(payload), more := false, e := true))
-					      },
-				    tlli := ms.tlli);
+					 cv := cv,
+					 bsn := ms.ul_tbf.bsn,
+					 blocks := blocks,
+					 tlli := ms.tlli);
 	f_ultbf_inc_bsn(ms.ul_tbf);
 	f_ms_tx_data_ind(ms, enc_RlcmacUlBlock(valueof(ul_data)));
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20702
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I175f8ce2606050c6b4ea54eae4e00846291d462f
Gerrit-Change-Number: 20702
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201019/3938ed55/attachment.htm>


More information about the gerrit-log mailing list