<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23554">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CTRL_Adapter: Add function to obtain FSM instance state<br><br>This can be useful to verify expectations about the state of FSMs<br>in the IUT.<br><br>Change-Id: I33afc2e73be06e23147b5ac0b0fd3b9003935444<br>---<br>M library/Osmocom_CTRL_Adapter.ttcn<br>1 file changed, 17 insertions(+), 0 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/54/23554/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn</span><br><span>index adc2887..34ea300 100644</span><br><span>--- a/library/Osmocom_CTRL_Adapter.ttcn</span><br><span>+++ b/library/Osmocom_CTRL_Adapter.ttcn</span><br><span>@@ -112,5 +112,22 @@</span><br><span>     f_ctrl_get_exp(pt, valueof(ts_bts_trx(bts_nr, trx_nr)) & suffix, exp);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+template (value) charstring ts_fsm_inst_id(charstring class_name, charstring inst_id) :=</span><br><span style="color: hsl(120, 100%, 40%);">+ "fsm." & class_name & ".id." & inst_id & ".";</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* obtain the state of a specified FSM instance */</span><br><span style="color: hsl(120, 100%, 40%);">+function f_ctrl_get_fsm_inst_state(IPA_CTRL_PT pt, charstring fsm_class_name, charstring fsm_inst_id)</span><br><span style="color: hsl(120, 100%, 40%);">+return charstring {</span><br><span style="color: hsl(120, 100%, 40%);">+ return f_ctrl_get(pt, valueof(ts_fsm_inst_id(fsm_class_name, fsm_inst_id)) & "state");</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* expect the state of a specified FSM instance to match template */</span><br><span style="color: hsl(120, 100%, 40%);">+function f_ctrl_get_exp_inst_state(IPA_CTRL_PT pt, charstring fsm_class_name,</span><br><span style="color: hsl(120, 100%, 40%);">+                                   template (value) charstring fsm_inst_id,</span><br><span style="color: hsl(120, 100%, 40%);">+                              template (present) CtrlValue exp)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       f_ctrl_get_exp(pt, valueof(ts_fsm_inst_id(fsm_class_name, valueof(fsm_inst_id))) & "state", exp);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> </span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23554">change 23554</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/+/23554"/><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: I33afc2e73be06e23147b5ac0b0fd3b9003935444 </div>
<div style="display:none"> Gerrit-Change-Number: 23554 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>