Change in osmo-ttcn3-hacks[master]: HLR_Tests.ttcn: suspend some compilation warnings

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Mar 29 16:44:12 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13448 )

Change subject: HLR_Tests.ttcn: suspend some compilation warnings
......................................................................

HLR_Tests.ttcn: suspend some compilation warnings

In the most use cases of f_SS_expect() we are not interested in
GSUP_PDU returned by this function. Calling it without storing
the returned value causes TTCN-3 compiler to complain:

  warning: The value returned by function
           `@HLR_Tests.f_SS_expect' is not used

Let's make use of previously unused variable 'res', and save
the returned GSUP_PDU to make the TTCN-3 compiler happy.

Change-Id: Ifda42aa18af8076013b436364513296b2b008731
---
M hlr/HLR_Tests.ttcn
1 file changed, 34 insertions(+), 20 deletions(-)

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



diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn
index e32fa68..da6ad7c 100644
--- a/hlr/HLR_Tests.ttcn
+++ b/hlr/HLR_Tests.ttcn
@@ -783,8 +783,9 @@
 					ussd_string := "*#200#");
 	GSUP.send(valueof(ts_GSUP_PROC_SS_REQ(g_pars.sub.imsi, g_pars.ussd.sid,
 						OSMO_GSUP_SESSION_STATE_BEGIN, ss)));
-	f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_END,
-		    tr_SS_FACILITY_RETURN_ERROR(1, 18));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_END,
+			   tr_SS_FACILITY_RETURN_ERROR(1, 18));
 }
 testcase TC_mo_ussd_unknown() runs on test_CT {
 	var HlrSubscriberList sl;
@@ -809,8 +810,9 @@
 					ussd_string := "*100#");
 	GSUP.send(valueof(ts_GSUP_PROC_SS_REQ(g_pars.sub.imsi, g_pars.ussd.sid,
 						OSMO_GSUP_SESSION_STATE_BEGIN, ss)));
-	f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_END,
-		    tr_SS_FACILITY_RETURN_ERROR(1, 34));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_END,
+			   tr_SS_FACILITY_RETURN_ERROR(1, 34));
 }
 testcase TC_mo_ussd_euse_disc() runs on test_CT {
 	var HlrSubscriberList sl;
@@ -837,8 +839,10 @@
 	GSUP.send(valueof(ts_GSUP_PROC_SS_REQ(g_pars.sub.imsi, g_pars.ussd.sid,
 						OSMO_GSUP_SESSION_STATE_BEGIN, ss)));
 	resp_str := "Your IMSI is " & hex2str(g_pars.sub.imsi);
-	f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_END,
-		    tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS, f_encGSM7bit(resp_str)));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_END,
+			   tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS,
+							     f_encGSM7bit(resp_str)));
 }
 testcase TC_mo_ussd_iuse_imsi() runs on test_CT {
 	var HlrSubscriberList sl;
@@ -865,8 +869,10 @@
 	GSUP.send(valueof(ts_GSUP_PROC_SS_REQ(g_pars.sub.imsi, g_pars.ussd.sid,
 						OSMO_GSUP_SESSION_STATE_BEGIN, ss)));
 	resp_str := "Your extension is " & hex2str(g_pars.sub.msisdn);
-	f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_END,
-		    tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS, f_encGSM7bit(resp_str)));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_END,
+			   tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS,
+							     f_encGSM7bit(resp_str)));
 }
 testcase TC_mo_ussd_iuse_msisdn() runs on test_CT {
 	var HlrSubscriberList sl;
@@ -893,8 +899,10 @@
 					ussd_string := "*100#");
 	GSUP.send(valueof(ts_GSUP_PROC_SS_REQ(g_pars.sub.imsi, g_pars.ussd.sid,
 						OSMO_GSUP_SESSION_STATE_BEGIN, ss)));
-	f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_END,
-		    tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS, f_encGSM7bit("*100#")));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_END,
+			   tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS,
+							     f_encGSM7bit("*100#")));
 }
 testcase TC_mo_ussd_euse() runs on test_CT {
 	var HlrSubscriberList sl;
@@ -925,8 +933,10 @@
 	GSUP.send(valueof(ts_GSUP_PROC_SS_REQ(g_pars.sub.imsi, g_pars.ussd.sid,
 						OSMO_GSUP_SESSION_STATE_BEGIN, ss)));
 	/* expect echo response from EUSE */
-	f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_CONTINUE,
-		    tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS, f_encGSM7bit("*100#")));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_CONTINUE,
+			   tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS,
+							     f_encGSM7bit("*100#")));
 
 	/* Simulate CONTINUE from MS/MSC */
 	ss := f_USSD_FACILITY_IE_INVOKE(op_code := SS_OP_CODE_PROCESS_USS_REQ,
@@ -935,9 +945,10 @@
 						OSMO_GSUP_SESSION_STATE_CONTINUE, ss)));
 
 	/* expect echo response from EUSE */
-	f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_END,
-		    tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS,
-						      f_encGSM7bit("mahlzeit")));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_END,
+			   tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS,
+							     f_encGSM7bit("mahlzeit")));
 }
 testcase TC_mo_ussd_euse_continue() runs on test_CT {
 	var HlrSubscriberList sl;
@@ -969,8 +980,10 @@
 					ussd_string := "*999#");
 	GSUP.send(valueof(ts_GSUP_PROC_SS_REQ(g_pars.sub.imsi, g_pars.ussd.sid,
 						OSMO_GSUP_SESSION_STATE_BEGIN, ss)));
-	f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_END,
-		    tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS, f_encGSM7bit("*999#")));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_END,
+			   tr_SS_USSD_FACILITY_RETURN_RESULT(1, 59, SS_USSD_DEFAULT_DCS,
+							     f_encGSM7bit("*999#")));
 }
 testcase TC_mo_ussd_euse_defaultroute() runs on test_CT {
 	var HlrSubscriberList sl;
@@ -1004,6 +1017,7 @@
  */
 private function f_TC_mo_sss_reject() runs on HLR_ConnHdlr {
 	var SS_FacilityInformation ss_req;
+	var GSUP_PDU res;
 
 	/* Prepare '*#21#' SS request */
 	ss_req := valueof(ts_SS_FACILITY_INVOKE(
@@ -1019,9 +1033,9 @@
 		enc_SS_FacilityInformation(ss_req))));
 
 	/* Expect ReturnError with FACILITY_NOT_SUPPORTED */
-	f_SS_expect(g_pars.sub.imsi,
-		g_pars.ussd.sid, OSMO_GSUP_SESSION_STATE_END,
-		tr_SS_FACILITY_RETURN_ERROR(0, 21));
+	res := f_SS_expect(g_pars.sub.imsi, g_pars.ussd.sid,
+			   OSMO_GSUP_SESSION_STATE_END,
+			   tr_SS_FACILITY_RETURN_ERROR(0, 21));
 }
 testcase TC_mo_sss_reject() runs on test_CT {
 	var HLR_ConnHdlrPars pars;

-- 
To view, visit https://gerrit.osmocom.org/13448
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifda42aa18af8076013b436364513296b2b008731
Gerrit-Change-Number: 13448
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190329/00c56536/attachment.html>


More information about the gerrit-log mailing list