From 2c77129c680683205664aa8ccb9acb1331584b51 Mon Sep 17 00:00:00 2001
From: Adam Knapp <adam.knapp@ericsson.com>
Date: Tue, 29 Jun 2021 12:23:08 +0200
Subject: [PATCH] Merging test for bugfix (issue #421, titan.core#555)

Signed-off-by: Adam Knapp <adam.knapp@ericsson.com>
---
 Regression_Test_java/single_main.cfg          |  2 +
 .../EncodeDecode/RAW/Issue555/Issue555.ttcn   | 60 +++++++++++++++++++
 .../src/EncodeDecode/RAW/Issue555/config.cfg  | 20 +++++++
 3 files changed, 82 insertions(+)
 create mode 100644 Regression_Test_java/src/EncodeDecode/RAW/Issue555/Issue555.ttcn
 create mode 100644 Regression_Test_java/src/EncodeDecode/RAW/Issue555/config.cfg

diff --git a/Regression_Test_java/single_main.cfg b/Regression_Test_java/single_main.cfg
index 8c7d6c9320..5b01bc006b 100644
--- a/Regression_Test_java/single_main.cfg
+++ b/Regression_Test_java/single_main.cfg
@@ -257,6 +257,8 @@ Test.control
 HS16977_Test.control
 #RAW/IntX
 IntX.control #ok! 6 pass
+#RAW/Issue555
+Issue555.control
 #RAW/Lengthto_Offset:
 Lengthto_Offset
 #RAW/RAW_bitstring_test:
diff --git a/Regression_Test_java/src/EncodeDecode/RAW/Issue555/Issue555.ttcn b/Regression_Test_java/src/EncodeDecode/RAW/Issue555/Issue555.ttcn
new file mode 100644
index 0000000000..836ecacdcc
--- /dev/null
+++ b/Regression_Test_java/src/EncodeDecode/RAW/Issue555/Issue555.ttcn
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * Copyright (c) 2000-2021 Ericsson Telecom AB
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ *
+ * Contributors:
+ *   Gabor, Szalai – initial implementation
+ *
+ ******************************************************************************/
+
+module Issue555 {
+
+
+type record MyRec{
+  MCC       mcc,
+  bitstring bs length(4)
+} with {
+  variant "FIELDORDER(msb)"
+}
+
+type hexstring MCC
+with {
+  variant "FIELDLENGTH (3)";
+  variant "FIELDORDER(msb)"
+  variant "HEXORDER (high)";
+}
+
+type component CT {}
+
+template MyRec t_hex:={
+  mcc:='042'H,
+  bs:='0000'B
+}
+
+testcase tc_issue555() runs on CT {
+  var bitstring bdata:='0000010000100000'B
+  var MyRec res
+  var integer i:=decvalue(bdata,res)
+  log(i)
+  if(i!=0){
+    setverdict(fail, "decvalue failed")
+  } else {
+    log(res)
+    if(match(res,t_hex)){
+      setverdict(pass)
+    } else {
+      setverdict(fail, "unmatched value")
+    }
+  }
+}
+
+control {
+  execute(tc_issue555());
+}
+
+} with {
+  encode "RAW"
+}
diff --git a/Regression_Test_java/src/EncodeDecode/RAW/Issue555/config.cfg b/Regression_Test_java/src/EncodeDecode/RAW/Issue555/config.cfg
new file mode 100644
index 0000000000..b3fe903f79
--- /dev/null
+++ b/Regression_Test_java/src/EncodeDecode/RAW/Issue555/config.cfg
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2000-2021 Ericsson Telecom AB
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+#
+# Contributors:
+#   Botond, Baranyi
+#
+###############################################################################
+[LOGGING]
+LogFile := "Issue555.log"
+FileMask := LOG_ALL
+ConsoleMask := TTCN_ERROR | TTCN_TESTCASE | TTCN_STATISTICS
+LogSourceInfo := Yes
+[EXECUTE]
+Issue555.control
+
+[TESTPORT_PARAMETERS]
-- 
GitLab