[PATCH] osmo-ttcn3-hacks[master]: msc: cosmetic: pass BSC_ConnHdlrPars to f_start_handler() as...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Mar 1 23:35:58 UTC 2018


Review at  https://gerrit.osmocom.org/7048

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(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/48/7048/1

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: newchange
Gerrit-Change-Id: I46de36a032c2473025d0eb01e5909dbcdaf394f7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list