<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19631">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bsc CBSP: fix tr_CBSP_KILL_FAIL, no lengthof() on record-of with '*'<br><br>Keep a local next_idx so that lengthof() doesn't fail after adding a '*' entry.<br>Fixes this error in BSC_Tests_CBSP.TC_cbsp_write_then_kill:<br><br> Dynamic test case error: Performing lengthof() operation on a template of type @CBSP_Types.CBSP_IEs with no exact length.<br><br>Change-Id: I4d95a8ca311f145fa5ea371b6aed099db771d7b8<br>---<br>M library/CBSP_Templates.ttcn<br>1 file changed, 15 insertions(+), 6 deletions(-)<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/31/19631/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/CBSP_Templates.ttcn b/library/CBSP_Templates.ttcn</span><br><span>index 49906fe..8d62742 100644</span><br><span>--- a/library/CBSP_Templates.ttcn</span><br><span>+++ b/library/CBSP_Templates.ttcn</span><br><span>@@ -581,20 +581,29 @@</span><br><span>               tr_CbspMsgId(msg_id),</span><br><span>                tr_OldSerNo(old_ser_nr)</span><br><span>      };</span><br><span style="color: hsl(120, 100%, 40%);">+    /* As soon as adding a '*' IE item, lengthof() no longer works on the ies record. So keep track of the</span><br><span style="color: hsl(120, 100%, 40%);">+         * next index to use separately. */</span><br><span style="color: hsl(120, 100%, 40%);">+   var integer next_idx := lengthof(ies);</span><br><span>       if (istemplatekind(compl_list, "*")) {</span><br><span style="color: hsl(0, 100%, 40%);">-                ies[lengthof(ies)] := *;</span><br><span style="color: hsl(120, 100%, 40%);">+              ies[next_idx] := *;</span><br><span style="color: hsl(120, 100%, 40%);">+           next_idx := next_idx + 1;</span><br><span>    } else if (not istemplatekind(compl_list, "omit")) {</span><br><span style="color: hsl(0, 100%, 40%);">-          ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);</span><br><span style="color: hsl(120, 100%, 40%);">+                ies[next_idx] := tr_CbspNumComplList(compl_list);</span><br><span style="color: hsl(120, 100%, 40%);">+             next_idx := next_idx + 1;</span><br><span>    }</span><br><span>    if (istemplatekind(cell_list, "*")) {</span><br><span style="color: hsl(0, 100%, 40%);">-         ies[lengthof(ies)] := *;</span><br><span style="color: hsl(120, 100%, 40%);">+              ies[next_idx] := *;</span><br><span style="color: hsl(120, 100%, 40%);">+           next_idx := next_idx + 1;</span><br><span>    } else if (not istemplatekind(cell_list, "omit")) {</span><br><span style="color: hsl(0, 100%, 40%);">-           ies[lengthof(ies)] := tr_CbspCellList(cell_list);</span><br><span style="color: hsl(120, 100%, 40%);">+             ies[next_idx] := tr_CbspCellList(cell_list);</span><br><span style="color: hsl(120, 100%, 40%);">+          next_idx := next_idx + 1;</span><br><span>    }</span><br><span>    if (istemplatekind(channel_ind, "*")) {</span><br><span style="color: hsl(0, 100%, 40%);">-               ies[lengthof(ies)] := *;</span><br><span style="color: hsl(120, 100%, 40%);">+              ies[next_idx] := *;</span><br><span style="color: hsl(120, 100%, 40%);">+           next_idx := next_idx + 1;</span><br><span>    } else if (not istemplatekind(channel_ind, "omit")) {</span><br><span style="color: hsl(0, 100%, 40%);">-         ies[lengthof(ies)] := tr_CbspChannelInd(channel_ind);</span><br><span style="color: hsl(120, 100%, 40%);">+         ies[next_idx] := tr_CbspChannelInd(channel_ind);</span><br><span style="color: hsl(120, 100%, 40%);">+              next_idx := next_idx + 1;</span><br><span>    }</span><br><span>    return tr_CBSP(CBSP_MSGT_KILL_COMPL, ies);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19631">change 19631</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/+/19631"/><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: I4d95a8ca311f145fa5ea371b6aed099db771d7b8 </div>
<div style="display:none"> Gerrit-Change-Number: 19631 </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>