Osmocom_CTRL_Fucntions: Add f_ctrl_get_ratectr_abs and f_ctrl_get_exp_ratectr_abs
diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn
index 89cf04f..a9fccb9 100644
--- a/library/Osmocom_CTRL_Functions.ttcn
+++ b/library/Osmocom_CTRL_Functions.ttcn
@@ -69,5 +69,24 @@
}
}
+ template charstring ts_ctrl_ratectr(CtrlVariable grp, integer instance, CtrlVariable name,
+ CtrlVariable kind := "abs") :=
+ "rate_ctr." & kind & "." & grp & "." & int2str(instance) & "." & name;
+
+ function f_ctrl_get_ratectr_abs(IPA_CTRL_PT pt, CtrlVariable grp, integer instance,
+ CtrlVariable name) return integer {
+ return str2int(f_ctrl_get(pt, valueof(ts_ctrl_ratectr(grp, instance, name))));
+ }
+
+ function f_ctrl_get_exp_ratectr_abs(IPA_CTRL_PT pt, CtrlVariable grp, integer instance,
+ CtrlVariable name, template integer exp) {
+ var charstring ctrl_resp;
+ var CtrlVariable variable := valueof(ts_ctrl_ratectr(grp, instance, name));
+ ctrl_resp := f_ctrl_get(pt, variable);
+ if (not match(str2int(ctrl_resp), exp)) {
+ setverdict(fail, variable & " value " & ctrl_resp & " didn't match ", exp);
+ }
+ }
+
}