Commit dd903a6b authored by balaskoa's avatar balaskoa
Browse files

Regression_Test_java/src/templateExclusiveRange copied from titan.core


Signed-off-by: default avatarbalaskoa <Jeno.Balasko@ericsson.com>
parent cc1cb676
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"src/recofOper/config.cfg" #62 pass + 2 tc moved to single_bugs.cfg "src/recofOper/config.cfg" #62 pass + 2 tc moved to single_bugs.cfg
"src/templateCharstr/config.cfg" "src/templateCharstr/config.cfg"
"src/templateExclusiveRange/config.cfg"
"src/templateRecof/config.cfg" #ok 38 pass "src/templateRecof/config.cfg" #ok 38 pass
"src/text2ttcn_nolegacy/text2ttcn_1.cfg" "src/text2ttcn_nolegacy/text2ttcn_1.cfg"
#"src/text2ttcn/text2ttcn_1.cfg" #legacy mode #"src/text2ttcn/text2ttcn_1.cfg" #legacy mode
......
...@@ -3,20 +3,9 @@ ...@@ -3,20 +3,9 @@
[MODULE_PARAMETERS] [MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. # This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
[EXECUTE]
#compileonly - not copied!
#configOper #par
#TconfigOper.control #parallel #TODO: implement the excluded interleave testcases
#connectMapOperNegTest
#ConnectMapOperNegTest #parallel ok 3 pass
TcontrolTimer
#CRTR00015758:
#no.control
#customEncoding: not implemented codings!
[ORDERED_INCLUDE] [ORDERED_INCLUDE]
#"src/assignmentNotation/TassignmentNotation.cfg"
#HACK: escaped double quote added, ass. not. nok, Error while setting parameter field 'tsp_editor' to 'vim': Referenced module parameter cannot be found. Module `vim' does not exist, and no parameter with name `vim' exists in any module. [EXECUTE]
#"src/ucharstrOper/config.cfg"
[LOGGING] [LOGGING]
# In this section you can specify the name of the log file and the classes of events # In this section you can specify the name of the log file and the classes of events
......
...@@ -47,10 +47,10 @@ testcase tc_integer() runs on EmptyCT { ...@@ -47,10 +47,10 @@ testcase tc_integer() runs on EmptyCT {
} }
var template integer tmp; var template integer tmp;
// string2ttcn(ttcn2string(positive_templ), tmp); string2ttcn(ttcn2string(positive_templ), tmp);
// if (log2str(positive_templ) != log2str(tmp)) { if (log2str(positive_templ) != log2str(tmp)) {
// setverdict(fail, "Expected: ", positive_templ, " Got: ", tmp); setverdict(fail, "Expected: ", positive_templ, " Got: ", tmp);
// } }
template integer negative_templ:= (!-10 .. !-1); template integer negative_templ:= (!-10 .. !-1);
f := -10; f := -10;
...@@ -126,10 +126,10 @@ testcase tc_float() runs on EmptyCT { ...@@ -126,10 +126,10 @@ testcase tc_float() runs on EmptyCT {
} }
var template float tmp; var template float tmp;
// string2ttcn(ttcn2string(positive_templ), tmp); string2ttcn(ttcn2string(positive_templ), tmp);
// if (log2str(positive_templ) != log2str(tmp)) { if (log2str(positive_templ) != log2str(tmp)) {
// setverdict(fail, "Expected: ", positive_templ, " Got: ", tmp); setverdict(fail, "Expected: ", positive_templ, " Got: ", tmp);
// } }
template float negative_templ := (!-10.0 .. !-1.0); template float negative_templ := (!-10.0 .. !-1.0);
f := -10.0; f := -10.0;
...@@ -169,10 +169,10 @@ testcase tc_float() runs on EmptyCT { ...@@ -169,10 +169,10 @@ testcase tc_float() runs on EmptyCT {
setverdict(fail, match(log2str(negative_templ), log2str(copy_negative_templ))); setverdict(fail, match(log2str(negative_templ), log2str(copy_negative_templ)));
} }
// string2ttcn(ttcn2string(negative_templ), tmp); string2ttcn(ttcn2string(negative_templ), tmp);
// if (log2str(negative_templ) != log2str(tmp)) { if (log2str(negative_templ) != log2str(tmp)) {
// setverdict(fail, "Expected: ", negative_templ, " Got: ", tmp); setverdict(fail, "Expected: ", negative_templ, " Got: ", tmp);
// } }
template float infinity_templ := (!-infinity .. !infinity); template float infinity_templ := (!-infinity .. !infinity);
if (match(f, infinity_templ) == false) { if (match(f, infinity_templ) == false) {
...@@ -239,11 +239,11 @@ testcase tc_charstring() runs on EmptyCT { ...@@ -239,11 +239,11 @@ testcase tc_charstring() runs on EmptyCT {
setverdict(fail, match(log2str(templ), log2str(copy_templ))); setverdict(fail, match(log2str(templ), log2str(copy_templ)));
} }
// var template charstring tmp; var template charstring tmp;
// string2ttcn(ttcn2string(templ), tmp); string2ttcn(ttcn2string(templ), tmp);
// if (log2str(templ) != log2str(tmp)) { if (log2str(templ) != log2str(tmp)) {
// setverdict(fail, "Expected: ", templ, " Got: ", tmp); setverdict(fail, "Expected: ", templ, " Got: ", tmp);
// } }
setverdict(pass); setverdict(pass);
} }
...@@ -291,10 +291,10 @@ testcase tc_universal_charstring() runs on EmptyCT { ...@@ -291,10 +291,10 @@ testcase tc_universal_charstring() runs on EmptyCT {
} }
var template universal charstring tmp; var template universal charstring tmp;
// string2ttcn(ttcn2string(charstr_templ), tmp); string2ttcn(ttcn2string(charstr_templ), tmp);
// if (log2str(charstr_templ) != log2str(tmp)) { if (log2str(charstr_templ) != log2str(tmp)) {
// setverdict(fail, "Expected: ", charstr_templ, " Got: ", tmp); setverdict(fail, "Expected: ", charstr_templ, " Got: ", tmp);
// } }
template universal charstring unicharstr_templ:= (!char(1,2,3,4) .. !char(1,2,4,5)); template universal charstring unicharstr_templ:= (!char(1,2,3,4) .. !char(1,2,4,5));
f := char(1,2,3,4); f := char(1,2,3,4);
...@@ -322,10 +322,10 @@ testcase tc_universal_charstring() runs on EmptyCT { ...@@ -322,10 +322,10 @@ testcase tc_universal_charstring() runs on EmptyCT {
setverdict(fail, match(log2str(unicharstr_templ), log2str(copy_unicharstr_templ))); setverdict(fail, match(log2str(unicharstr_templ), log2str(copy_unicharstr_templ)));
} }
// string2ttcn(ttcn2string(unicharstr_templ), tmp); string2ttcn(ttcn2string(unicharstr_templ), tmp);
// if (log2str(unicharstr_templ) != log2str(tmp)) { if (log2str(unicharstr_templ) != log2str(tmp)) {
// setverdict(fail, "Expected: ", unicharstr_templ, " Got: ", tmp); setverdict(fail, "Expected: ", unicharstr_templ, " Got: ", tmp);
// } }
setverdict(pass); setverdict(pass);
} }
......
/******************************************************************************
* Copyright (c) 2000-2019 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:
* Szabo, Bence Janos
*
******************************************************************************/
module ExclusiveRangeTemplateMP {
modulepar template integer mp_int_positive_templ;
modulepar template integer mp_int_negative_templ;
modulepar template float mp_float_positive_templ;
modulepar template float mp_float_negative_templ;
modulepar template float mp_float_infinity_templ;
modulepar template charstring mp_charstring_templ;
modulepar template universal charstring mp_unicharstring_charstring_templ;
modulepar template universal charstring mp_unicharstring_unicharstring_templ;
type component EmptyCT {}
testcase tc_integer_mp() runs on EmptyCT {
var integer f := 10;
if (match(f, mp_int_positive_templ)) {
setverdict(fail, match(f, mp_int_positive_templ));
}
f := 1;
if (match(f, mp_int_positive_templ)) {
setverdict(fail, match(f, mp_int_positive_templ));
}
f := 0;
if (match(f, mp_int_positive_templ)) {
setverdict(fail, match(f, mp_int_positive_templ));
}
f := 2;
if (match(f, mp_int_positive_templ) == false) {
setverdict(fail, match(f, mp_int_positive_templ));
}
f := 9;
if (match(f, mp_int_positive_templ) == false) {
setverdict(fail, match(f, mp_int_positive_templ));
}
if ("(!1 .. !10)" != log2str(mp_int_positive_templ)) {
setverdict(fail, match("(!1 .. !10)", log2str(mp_int_positive_templ)));
}
template integer copy_mp_int_positive_templ := mp_int_positive_templ;
if (log2str(mp_int_positive_templ) != log2str(copy_mp_int_positive_templ)) {
setverdict(fail, match(log2str(mp_int_positive_templ), log2str(copy_mp_int_positive_templ)));
}
var template integer tmp;
string2ttcn(ttcn2string(mp_int_positive_templ), tmp);
if (log2str(mp_int_positive_templ) != log2str(tmp)) {
setverdict(fail, "Expected: ", mp_int_positive_templ, " Got: ", tmp);
}
f := -10;
if (match(f, mp_int_negative_templ) == false) {
setverdict(fail, match(f, mp_int_negative_templ));
}
f := -1;
if (match(f, mp_int_negative_templ) == false) {
setverdict(fail, match(f, mp_int_negative_templ));
}
f := 0;
if (match(f, mp_int_negative_templ) == false) {
setverdict(fail, match(f, mp_int_negative_templ));
}
f := -1;
if (match(f, mp_int_negative_templ) == false) {
setverdict(fail, match(f, mp_int_negative_templ));
}
f := -2;
if (match(f, mp_int_negative_templ) == false) {
setverdict(fail, match(f, mp_int_negative_templ));
}
f := -9;
if (match(f, mp_int_negative_templ) == false) {
setverdict(fail, match(f, mp_int_negative_templ));
}
if ("(-infinity .. !1)" != log2str(mp_int_negative_templ)) {
setverdict(fail, match("(-infinity .. !1)", log2str(mp_int_negative_templ)));
}
template integer copy_negative_templ := mp_int_negative_templ;
if (log2str(mp_int_negative_templ) != log2str(copy_negative_templ)) {
setverdict(fail, match(log2str(mp_int_negative_templ), log2str(copy_negative_templ)));
}
string2ttcn(ttcn2string(mp_int_negative_templ), tmp);
if (log2str(mp_int_negative_templ) != log2str(tmp)) {
setverdict(fail, "Expected: ", mp_int_negative_templ, " Got: ", tmp);
}
setverdict(pass);
}
testcase tc_float_mp() runs on EmptyCT {
template float positive_templ:= (!1.0 .. !10.0);
var float f := 10.0;
if (match(f, mp_float_positive_templ)) {
setverdict(fail, match(f, mp_float_positive_templ));
}
f := 1.0;
if (match(f, mp_float_positive_templ)) {
setverdict(fail, match(f, mp_float_positive_templ));
}
f := 0.0;
if (match(f, mp_float_positive_templ)) {
setverdict(fail, match(f, mp_float_positive_templ));
}
f := 1.0;
if (match(f, 11.0)) {
setverdict(fail, match(f, mp_float_positive_templ));
}
f := 2.0;
if (match(f, mp_float_positive_templ) == false) {
setverdict(fail, match(f, mp_float_positive_templ));
}
f := 9.0;
if (match(f, mp_float_positive_templ) == false) {
setverdict(fail, match(f, mp_float_positive_templ));
}
if ("(!1.000000 .. !10.000000)" != log2str(mp_float_positive_templ)) {
setverdict(fail, match("(!1.000000 .. !10.000000)", log2str(mp_float_positive_templ)));
}
template float copy_positive_templ := mp_float_positive_templ;
if (log2str(mp_float_positive_templ) != log2str(copy_positive_templ)) {
setverdict(fail, match(log2str(mp_float_positive_templ), log2str(copy_positive_templ)));
}
var template float tmp;
string2ttcn(ttcn2string(mp_float_positive_templ), tmp);
if (log2str(mp_float_positive_templ) != log2str(tmp)) {
setverdict(fail, "Expected: ", mp_float_positive_templ, " Got: ", tmp);
}
f := -10.0;
if (match(f, mp_float_negative_templ)) {
setverdict(fail, match(f, mp_float_negative_templ));
}
f := -1.0;
if (match(f, mp_float_negative_templ)) {
setverdict(fail, match(f, mp_float_negative_templ));
}
f := -0.0;
if (match(f, mp_float_negative_templ)) {
setverdict(fail, match(f, mp_float_negative_templ));
}
f := -11.0;
if (match(f, mp_float_negative_templ)) {
setverdict(fail, match(f, mp_float_negative_templ));
}
f := -2.0;
if (match(f, mp_float_negative_templ) == false) {
setverdict(fail, match(f, mp_float_negative_templ));
}
f := -9.0;
if (match(f, mp_float_negative_templ) == false) {
setverdict(fail, match(f, mp_float_negative_templ));
}
f := -5.0;
if (match(f, mp_float_negative_templ) == false) {
setverdict(fail, match(f, mp_float_negative_templ));
}
if ("(!-10.000000 .. !-1.000000)" != log2str(mp_float_negative_templ)) {
setverdict(fail, match("(!-10.000000 .. !-1.000000)", log2str(mp_float_negative_templ)));
}
template float copy_negative_templ := mp_float_negative_templ;
if (log2str(mp_float_negative_templ) != log2str(copy_negative_templ)) {
setverdict(fail, match(log2str(mp_float_negative_templ), log2str(copy_negative_templ)));
}
string2ttcn(ttcn2string(mp_float_negative_templ), tmp);
if (log2str(mp_float_negative_templ) != log2str(tmp)) {
setverdict(fail, "Expected: ", mp_float_negative_templ, " Got: ", tmp);
}
if (match(f, mp_float_infinity_templ) == false) {
setverdict(fail, match(f, mp_float_infinity_templ));
}
f := -infinity;
if (match(f, mp_float_infinity_templ)) {
setverdict(fail, match(f, mp_float_infinity_templ));
}
f := infinity;
if (match(f, mp_float_infinity_templ)) {
setverdict(fail, match(f, mp_float_infinity_templ));
}
if ("(!-infinity .. !10.000000)" != log2str(mp_float_infinity_templ)) {
setverdict(fail, match("(!-infinity .. !10.000000)", log2str(mp_float_infinity_templ)));
}
template float copy_infinity_templ := mp_float_infinity_templ;
if (log2str(mp_float_infinity_templ) != log2str(copy_infinity_templ)) {
setverdict(fail, match(log2str(mp_float_infinity_templ), log2str(copy_infinity_templ)));
}
string2ttcn(ttcn2string(mp_float_infinity_templ), tmp);
if (log2str(mp_float_infinity_templ) != log2str(tmp)) {
setverdict(fail, "Expected: ", mp_float_infinity_templ, " Got: ", tmp);
}
setverdict(pass);
}
testcase tc_charstring_mp() runs on EmptyCT {
var charstring f := "d";
if (match(f, mp_charstring_templ)) {
setverdict(fail, match(f, mp_charstring_templ));
}
f := "g";
if (match(f, mp_charstring_templ)) {
setverdict(fail, match(f, mp_charstring_templ));
}
f := "f";
if (match(f, mp_charstring_templ) == false) {
setverdict(fail, match(f, mp_charstring_templ));
}
f := "j";
if (match(f, mp_charstring_templ)) {
setverdict(fail, match(f, mp_charstring_templ));
}
f := "eeefff";
if (match(f, mp_charstring_templ) == false) {
setverdict(fail, match(f, mp_charstring_templ));
}
f := "dddeeefff";
if (match(f, mp_charstring_templ)) {
setverdict(fail, match(f, mp_charstring_templ));
}
f := "eeefffggg";
if (match(f, mp_charstring_templ)) {
setverdict(fail, match(f, mp_charstring_templ));
}
if ("(!\"d\" .. !\"g\")" != log2str(mp_charstring_templ)) {
setverdict(fail, match("(!\"d\" .. !\"g\")", log2str(mp_charstring_templ)));
}
template charstring copy_templ := mp_charstring_templ;
if (log2str(mp_charstring_templ) != log2str(copy_templ)) {
setverdict(fail, match(log2str(mp_charstring_templ), log2str(copy_templ)));
}
var template charstring tmp;
string2ttcn(ttcn2string(mp_charstring_templ), tmp);
if (log2str(mp_charstring_templ) != log2str(tmp)) {
setverdict(fail, "Expected: ", mp_charstring_templ, " Got: ", tmp);
}
setverdict(pass);
}
testcase tc_universal_charstring_mp() runs on EmptyCT {
var universal charstring f := "d";
if (match(f, mp_unicharstring_charstring_templ)) {
setverdict(fail, match(f, mp_unicharstring_charstring_templ));
}
f := "g";
if (match(f, mp_unicharstring_charstring_templ)) {
setverdict(fail, match(f, mp_unicharstring_charstring_templ));
}
f := "f";
if (match(f, mp_unicharstring_charstring_templ) == false) {
setverdict(fail, match(f, mp_unicharstring_charstring_templ));
}
f := "j";
if (match(f, mp_unicharstring_charstring_templ)) {
setverdict(fail, match(f, mp_unicharstring_charstring_templ));
}
f := "eeefff";
if (match(f, mp_unicharstring_charstring_templ) == false) {
setverdict(fail, match(f, mp_unicharstring_charstring_templ));
}
f := "dddeeefff";
if (match(f, mp_unicharstring_charstring_templ)) {
setverdict(fail, match(f, mp_unicharstring_charstring_templ));
}
f := "eeefffggg";
if (match(f, mp_unicharstring_charstring_templ)) {
setverdict(fail, match(f, mp_unicharstring_charstring_templ));
}
if ("(!\"d\" .. !\"g\")" != log2str(mp_unicharstring_charstring_templ)) {
setverdict(fail, match("(!\"d\" .. !\"g\")", log2str(mp_unicharstring_charstring_templ)));
}
template universal charstring copy_charstr_templ := mp_unicharstring_charstring_templ;
if (log2str(mp_unicharstring_charstring_templ) != log2str(copy_charstr_templ)) {
setverdict(fail, match(log2str(mp_unicharstring_charstring_templ), log2str(copy_charstr_templ)));
}
var template universal charstring tmp;
string2ttcn(ttcn2string(mp_unicharstring_charstring_templ), tmp);
if (log2str(mp_unicharstring_charstring_templ) != log2str(tmp)) {
setverdict(fail, "Expected: ", mp_unicharstring_charstring_templ, " Got: ", tmp);
}
f := char(1,2,3,4);
if (match(f, mp_unicharstring_unicharstring_templ)) {
setverdict(fail, match(f, mp_unicharstring_unicharstring_templ));
}
f := char(1,2,4,5);
if (match(f, mp_unicharstring_unicharstring_templ)) {
setverdict(fail, match(f, mp_unicharstring_unicharstring_templ));
}
f := char(1,2,3,5);
if (match(f, mp_unicharstring_unicharstring_templ) == false) {
setverdict(fail, match(f, mp_unicharstring_unicharstring_templ));
}
f := char(1,2,4,4);
if (match(f, mp_unicharstring_unicharstring_templ) == false) {
setverdict(fail, match(f, mp_unicharstring_unicharstring_templ));
}
if ("(!char(1, 2, 3, 4) .. !char(1, 2, 4, 5))" != log2str(mp_unicharstring_unicharstring_templ)) {
setverdict(fail, match("(!char(1, 2, 3, 4) .. !char(1, 2, 4, 5))", log2str(mp_unicharstring_unicharstring_templ)));
}
template universal charstring copy_unicharstr_templ := mp_unicharstring_unicharstring_templ;
if (log2str(mp_unicharstring_unicharstring_templ) != log2str(copy_unicharstr_templ)) {
setverdict(fail, match(log2str(mp_unicharstring_unicharstring_templ), log2str(copy_unicharstr_templ)));
}
string2ttcn(ttcn2string(mp_unicharstring_unicharstring_templ), tmp);
if (log2str(mp_unicharstring_unicharstring_templ) != log2str(tmp)) {
setverdict(fail, "Expected: ", mp_unicharstring_unicharstring_templ, " Got: ", tmp);
}
setverdict(pass);
}
control {
execute(tc_integer_mp());
execute(tc_float_mp());
execute(tc_charstring_mp());
execute(tc_universal_charstring_mp());
}
}
\ No newline at end of file
###############################################################################
# Copyright (c) 2000-2019 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:
# Szabo, Bence Janos
#
###############################################################################
[MODULE_PARAMETERS]
ExclusiveRangeTemplateMP.mp_int_positive_templ := (!1 .. !10)
ExclusiveRangeTemplateMP.mp_int_negative_templ := (-infinity .. !1)
ExclusiveRangeTemplateMP.mp_float_positive_templ := (!1.0 .. !10.0)
ExclusiveRangeTemplateMP.mp_float_negative_templ := (!-10.0 .. !-1.0)
ExclusiveRangeTemplateMP.mp_float_infinity_templ := (!-infinity .. !10.0)
ExclusiveRangeTemplateMP.mp_charstring_templ := (!"d" .. !"g")
ExclusiveRangeTemplateMP.mp_unicharstring_charstring_templ := (!"d" .. !"g")
ExclusiveRangeTemplateMP.mp_unicharstring_unicharstring_templ := (!char(1,2,3,4) .. !char(1,2,4,5))
[LOGGING]
Logfile := "exclusiverangetempalte.log"
FileMask := LOG_ALL
ConsoleMask := TTCN_WARNING | TTCN_ERROR | TTCN_TESTCASE | TTCN_STATISTICS
[EXECUTE]
ExclusiveRangeTemplate
ExclusiveRangeTemplateMP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment