Harald Welte has submitted this change and it was merged.

Change subject: msc: cosmetic: pass BSC_ConnHdlrPars to f_start_handler() as 
argument
......................................................................


msc: cosmetic: pass BSC_ConnHdlrPars to f_start_handler() as argument

Previously, f_start_handler() would initialize the BSC_ConnHdlrPars instance,
making it impossible to change those parameters before the test function was
invoked.

Add separate f_init_pars() function that sets the default parameters.

Change f_start_handler() to take a BSC_ConnHdlrPars argument; i.e. that
f_init_pars() can be called first, the parameters can then be modified and
finally fed into f_start_handler().

Change-Id: I46de36a032c2473025d0eb01e5909dbcdaf394f7
---
M msc/MSC_Tests.ttcn
1 file changed, 11 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 7347caf..517afe0 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -338,9 +338,7 @@
 type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on 
BSC_ConnHdlr;
 
 /* FIXME: move into BSC_ConnectionHandler? */
-function f_start_handler(void_fn fn, integer imsi_suffix) runs on MTC_CT 
return BSC_ConnHdlr {
-       var BSC_ConnHdlr vc_conn;
-       var charstring id := testcasename();
+function f_init_pars(integer imsi_suffix) runs on MTC_CT return 
BSC_ConnHdlrPars {
        var BSC_ConnHdlrNetworkPars net_pars := {
                kc_support := '0A'O,    /* A5/1 and A5/3 enabled */
                expect_tmsi := true,
@@ -362,6 +360,12 @@
                net := net_pars,
                send_early_cm := true
        };
+       return pars;
+}
+
+function f_start_handler_with_pars(void_fn fn, BSC_ConnHdlrPars pars) runs on 
MTC_CT return BSC_ConnHdlr {
+       var BSC_ConnHdlr vc_conn;
+       var charstring id := testcasename();
 
        vc_conn := BSC_ConnHdlr.create(id);
        /* BSSMAP part / A interface */
@@ -383,6 +387,10 @@
        return vc_conn;
 }
 
+function f_start_handler(void_fn fn, integer imsi_suffix) runs on MTC_CT 
return BSC_ConnHdlr {
+       return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix));
+}
+
 private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars 
pars) runs on BSC_ConnHdlr {
        f_init_handler(pars);
        f_perform_lu();

-- 
To view, visit https://gerrit.osmocom.org/7048
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I46de36a032c2473025d0eb01e5909dbcdaf394f7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to