[PATCH] osmo-ttcn3-hacks[master]: BSSGP_Emulation: use 'isvalue()' instead of 'isbound()'

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Feb 18 13:07:23 UTC 2018


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

BSSGP_Emulation: use 'isvalue()' instead of 'isbound()'

This seems to be a bug in TITAN 6.1.0: isbound() on a bound-value
still returns false.  isvalue() however returns true if the variable
is bound, while still returning false if it is not.

Change-Id: If6e9ea970a90470a98a33e50ea5cff0fd1781719
---
M library/BSSGP_Emulation.ttcn
1 file changed, 9 insertions(+), 9 deletions(-)


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

diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn
index 1ced242..0be12e8 100644
--- a/library/BSSGP_Emulation.ttcn
+++ b/library/BSSGP_Emulation.ttcn
@@ -266,8 +266,8 @@
 runs on BSSGP_CT {
 	var integer i;
 	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (not isbound(ClientTable[i].comp_ref)) {
-			log("Adding Client IMSI=", imsi, ", TLLI=", tlli, ", index=", i);
+		if (not isvalue(ClientTable[i].comp_ref)) {
+			log("Adding Client=", vc_conn, ", IMSI=", imsi, ", TLLI=", tlli, ", index=", i);
 			ClientTable[i] := {
 				tlli := tlli,
 				tlli_old := omit,
@@ -289,7 +289,7 @@
 private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT {
 	var integer i;
 	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (isbound(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) {
+		if (isvalue(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) {
 			if (ClientTable[i].comp_ref != vc_conn) {
 				setverdict(fail, "Cannot unregister IMSI ", imsi, " registred to ",
 					   ClientTable[i].comp_ref, " from ", vc_conn);
@@ -326,7 +326,7 @@
 private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSGP_Client_CT {
 	var integer i;
 	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (isbound(ClientTable[i].imsi) and isbound(ClientTable[i].comp_ref)
+		if (isvalue(ClientTable[i].imsi) and isvalue(ClientTable[i].comp_ref)
 		    and ClientTable[i].imsi == imsi) {
 			return ClientTable[i].comp_ref;
 		}
@@ -338,9 +338,9 @@
 private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT {
 	var integer i;
 	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (isbound(ClientTable[i].comp_ref) and
-		    (isbound(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or
-		     isbound(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) {
+		if (isvalue(ClientTable[i].comp_ref) and
+		    (isvalue(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or
+		     isvalue(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) {
 			return ClientTable[i].comp_ref;
 		}
 	}
@@ -351,7 +351,7 @@
 private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return integer {
 	var integer i;
 	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (isbound(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) {
+		if (isvalue(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) {
 			return i;
 		}
 	}
@@ -362,7 +362,7 @@
 private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return OCT4 {
 	var integer i;
 	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (isbound(ClientTable[i].tlli) and isbound(ClientTable[i].comp_ref)
+		if (isvalue(ClientTable[i].tlli) and isvalue(ClientTable[i].comp_ref)
 		    and ClientTable[i].comp_ref == comp_ref) {
 			return ClientTable[i].tlli;
 		}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6e9ea970a90470a98a33e50ea5cff0fd1781719
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>


More information about the gerrit-log mailing list