<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19587">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bsc CBSP: f_gen_page(): fix generated payload size range<br><br>Fix the length calculation to provide a range of [1..82].<br><br>f_rnd_int() generates [0..max[ (i.e., < max), so f_gen_page() so far has a<br>payload len range of [0..81]. We want no zero payload, and we want a maximum of<br>82 bytes (page max of 88 minus 6 header bytes).<br><br>Change-Id: Id521b6038a23dc8e71ea25475bcdef7bc8917531<br>---<br>M bsc/BSC_Tests_CBSP.ttcn<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/19587/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn</span><br><span>index 2399c3a..f54de9b 100644</span><br><span>--- a/bsc/BSC_Tests_CBSP.ttcn</span><br><span>+++ b/bsc/BSC_Tests_CBSP.ttcn</span><br><span>@@ -136,7 +136,10 @@</span><br><span> }</span><br><span> </span><br><span> function f_gen_page() return CBSP_IE {</span><br><span style="color: hsl(0, 100%, 40%);">-    var integer len := f_rnd_int(82);</span><br><span style="color: hsl(120, 100%, 40%);">+     /* The maximum CBSP page payload space is 88, but 6 bytes of payload header are added in the first page: the</span><br><span style="color: hsl(120, 100%, 40%);">+   * maximum length generated here thus is 82. The minimum generated length is 1 (avoiding zero length).</span><br><span style="color: hsl(120, 100%, 40%);">+         * note, f_rnd_int(82) returns [0..81], so this results in a len ranging [1..82]: */</span><br><span style="color: hsl(120, 100%, 40%);">+  var integer len := 1 + f_rnd_int(82);</span><br><span>        var octetstring payload := f_rnd_octstring(len);</span><br><span>     return valueof(ts_CbspMsgContent(payload, len));</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19587">change 19587</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19587"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id521b6038a23dc8e71ea25475bcdef7bc8917531 </div>
<div style="display:none"> Gerrit-Change-Number: 19587 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>