osmith has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14755 )

Change subject: library: allow "?" in tr_ML3_MT_MM_ID_Req again
......................................................................

library: allow "?" in tr_ML3_MT_MM_ID_Req again

Fix MSC test TC_lu_by_imei, which uses tr_ML3_MT_MM_ID_Req with the
default "?" (AnyElement) parameter. It was failing with the following
runtime error:

Dynamic test case error: Performing a valueof or send operation on a 
non-specific template of enumerated type @L3_Templates.CmIdentityType.

Fixes: 328984591372ad5abf51655a51d45d880bfed182 ("L3_Templates: add enum 
CmIdentityType")
Related: https://www.eclipse.org/forums/index.php/t/1099816/
Change-Id: Ie7fbe52ac3c0c8f233680dcc311febec77d2ed0b
---
M library/L3_Templates.ttcn
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index 3011919..bc0e797 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -873,6 +873,14 @@
        }
 }

+private function f_id_type_or_any(template CmIdentityType id_type) return 
template bitstring {
+       if (istemplatekind(id_type, "?")) {
+               return ?;
+       } else {
+               return int2bit(enum2int(valueof(id_type)), 3);
+       }
+}
+
 template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template CmIdentityType id_type := 
?) := {
        discriminator := '0101'B,
        tiOrSkip := {
@@ -883,7 +891,7 @@
                        identityRequest := {
                                messageType := '011000'B,
                                nsd := '00'B,
-                               identityType := 
int2bit(enum2int(valueof(id_type)), 3),
+                               identityType := f_id_type_or_any(id_type),
                                spare1_5 := ?
                        }
                }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14755
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie7fbe52ac3c0c8f233680dcc311febec77d2ed0b
Gerrit-Change-Number: 14755
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to