Commit 5a8e6ae8 authored by Adrien Kirjak's avatar Adrien Kirjak
Browse files

Added tests


Signed-off-by: default avatarAdrien Kirjak <adrien.kirjak@ericsson.com>
parent 7f35690d
......@@ -6520,6 +6520,93 @@ error: Unmatched `\]'. Did you mean `\\\]'\?
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_B010504_match_referenced_characters_001 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles template matching of character pattern reference characters >
<COMPILE>
<EXECUTE_PARALLEL>
<MODULE TTCN NegSem_B010504_match_referenced_characters_001 NegSem_B010504_match_referenced_characters_001.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters
** @verdict pass reject
***************************************************/
module NegSem_B010504_match_referenced_characters_001 {
modulepar {
charstring MOD_REF:="ef";
}
type charstring CharRange ("e".."t");
type record MessageType {
charstring field1,
charstring field2,
charstring field3,
charstring field4,
charstring field5,
charstring field6
}
type port loopbackPort message {
inout MessageType
} with {extension "internal"}
type component GeneralComp {
port loopbackPort messagePort;
const charstring c_Ref:="s";
}
testcase TC_NegSem_B010504_match_referenced_characters_001(charstring p_Ref) runs on GeneralComp {
var MessageType v_testMessage;
var charstring v_Ref:="s";
template charstring m_Ref:="s";
template MessageType mw_matchingTemplate:= {
field1 := pattern "te[\N{v_Ref}]t",
field2 := pattern "[\N{c_Ref}et]+",
field3 := pattern "[\N{MOD_REF}-t]+", //reference length is more than one character
field4 := pattern "te[\N{p_Ref}]t",
field5 := pattern "te[\N{m_Ref}]t",
field6 := pattern "\N{CharRange}+"
};
v_testMessage:= {
field1 := "test",
field2 := "test",
field3 := "test",
field4 := "test",
field5 := "test",
field6 := "test"
};
connect(self:messagePort, self:messagePort);
messagePort.send(v_testMessage);
}
control{
execute(TC_NegSem_B010504_match_referenced_characters_001("s"));
}
}
<END_MODULE>
<RESULT COUNT 1>
Dynamic test case error: The length of the charstring must be of length one, when it is being referenced in a pattern with \\N\{ref\}
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSyn_B010505_pattern_compatibility_001 negative test
.*---------------------------------------------------------------------*
......
......@@ -21,7 +21,7 @@ testcase TC_Sem_070101_ArithmeticOperators_040() runs on GeneralComp {
var float v_result := v_k / v_i; // -Infinity special float as denominator
if (v_result == 0.0) { setverdict(pass,"match") }
if (v_result == -0.00000) { setverdict(pass,"match") }
else { setverdict(fail,v_result) }
......
......@@ -4,8 +4,8 @@
* Adrien Kirjak
*
** @version 0.0.1
** @purpose 1:7.1.3, Ensure that the equal to operator on address with value null is evaulated correctly
** @verdict pass accept, ttcn3verdict:pass
** @purpose 1:7.1.1, Ensure that arithmetic operators can not handle special float values
** @verdict pass reject
*****************************************************************/
module Sem_070101_ArithmeticOperators_051 {
......@@ -13,21 +13,15 @@ module Sem_070101_ArithmeticOperators_051 {
type component GeneralComp {
}
type integer address;
testcase TC_Sem_070101_ArithmeticOperators_051() runs on GeneralComp {
var float v_i := -infinity;
var float v_k :=2.0E0;
var address My_address := null;
var float v_result := v_i * v_k; // arithmetic operator with -infinity is not allowed
setverdict(pass);
if (My_address == null)
{
setverdict(pass, My_address);
} else {
setverdict(fail,My_address);
}
}
control{
execute(TC_Sem_070101_ArithmeticOperators_051());
}
......
......@@ -4,26 +4,23 @@
* Adrien Kirjak
*
** @version 0.0.1
** @purpose 1:7.1.3, Ensure that the not equal to operator on address with value null is evaulated correctly
** @purpose 1:7.1.3, Ensure that the equal to operator on address with value null is evaulated correctly
** @verdict pass accept, ttcn3verdict:pass
*****************************************************************/
/* Restriction c) With the exception of the equality and non-equality operators, the special value null shall not be used as an operand of expressions (see clause 7.1.3).*/
module Sem_070101_ArithmeticOperators_052 {
module Sem_070101_ArithmeticOperators_051 {
type component GeneralComp {
}
type integer address;
testcase TC_Sem_070101_ArithmeticOperators_052() runs on GeneralComp {
testcase TC_Sem_070101_ArithmeticOperators_051() runs on GeneralComp {
var address My_address := 1;
var address My_address := null;
if (My_address != null)
if (My_address == null)
{
setverdict(pass, My_address);
} else {
......@@ -32,7 +29,7 @@ testcase TC_Sem_070101_ArithmeticOperators_052() runs on GeneralComp {
}
control{
execute(TC_Sem_070101_ArithmeticOperators_052());
execute(TC_Sem_070101_ArithmeticOperators_051());
}
}
/******************************************************************************
* Copyright (C) 2016 ETSI All Rights Reserved.
*
* Adrien Kirjak
*
** @version 0.0.1
** @purpose 1:7.1.3, Ensure that the not equal to operator on address with value null is evaulated correctly
** @verdict pass accept, ttcn3verdict:pass
*****************************************************************/
/* Restriction c) With the exception of the equality and non-equality operators, the special value null shall not be used as an operand of expressions (see clause 7.1.3).*/
module Sem_070101_ArithmeticOperators_052 {
type component GeneralComp {
}
type integer address;
testcase TC_Sem_070101_ArithmeticOperators_052() runs on GeneralComp {
var address My_address := 1;
if (My_address != null)
{
setverdict(pass, My_address);
} else {
setverdict(fail,My_address);
}
}
control{
execute(TC_Sem_070101_ArithmeticOperators_052());
}
}
......@@ -30,7 +30,7 @@ module Sem_220202_ReceiveOperation_029 {
p[1].send(1);
p[1].send(2);
p[1].send(3);
any from p.receive(integer:?) -> @index v_int;
any from p.receive(integer:?) -> @index value v_int;
if (v_int == 1) { // evaluation of @lazy (receive shall not be called again)
alt {
......
......@@ -30,7 +30,7 @@ module Sem_220203_TriggerOperation_028 {
p[1].send(1);
p[1].send(2);
p[1].send(3);
any from p.trigger(integer:?) -> @index v_int;
any from p.trigger(integer:?) -> @index value v_int;
if (v_int == 1) { // evaluation of @lazy (receive shall not be called again)
alt {
......
......@@ -492,6 +492,31 @@ Sem_070101_ArithmeticOperators_023.control
Sem_070101_ArithmeticOperators_024.control
Sem_070101_ArithmeticOperators_025.control
Sem_070101_ArithmeticOperators_026.control
Sem_070101_ArithmeticOperators_027.control
Sem_070101_ArithmeticOperators_028.control
Sem_070101_ArithmeticOperators_029.control
Sem_070101_ArithmeticOperators_030.control
Sem_070101_ArithmeticOperators_031.control
Sem_070101_ArithmeticOperators_032.control
Sem_070101_ArithmeticOperators_033.control
Sem_070101_ArithmeticOperators_034.control
Sem_070101_ArithmeticOperators_035.control
Sem_070101_ArithmeticOperators_036.control
Sem_070101_ArithmeticOperators_037.control
Sem_070101_ArithmeticOperators_038.control
Sem_070101_ArithmeticOperators_039.control
Sem_070101_ArithmeticOperators_040.control
Sem_070101_ArithmeticOperators_041.control
Sem_070101_ArithmeticOperators_042.control
Sem_070101_ArithmeticOperators_043.control
Sem_070101_ArithmeticOperators_044.control
Sem_070101_ArithmeticOperators_045.control
Sem_070101_ArithmeticOperators_046.control
Sem_070101_ArithmeticOperators_047.control
Sem_070101_ArithmeticOperators_048.control
Sem_070101_ArithmeticOperators_049.control
Sem_070101_ArithmeticOperators_050.control
Sem_070101_ArithmeticOperators_051.control
Sem_070102_ListOperator_001.control
Sem_070102_ListOperator_002.control
Sem_070102_ListOperator_003.control
......@@ -1223,6 +1248,7 @@ Sem_B010205_value_range_003.control
Sem_B010205_value_range_004.control
Sem_B010205_value_range_005.control
Sem_B010205_value_range_006.control
Sem_B010205_value_range_007.control
Sem_B010206_superset_001.control
Sem_B010206_superset_002.control
Sem_B010206_superset_003.control
......@@ -1294,6 +1320,13 @@ Sem_B010503_match_n_times_002.control
Sem_B010503_match_n_times_003.control
Sem_B010503_match_n_times_004.control
Sem_B010503_match_n_times_005.control
Sem_B010504_match_referenced_characters_001.control
Sem_B010504_match_referenced_characters_002.control
Sem_B010504_match_referenced_characters_003.control
Sem_B010504_match_referenced_characters_004.control
Sem_B010504_match_referenced_characters_005.control
Sem_B010504_match_referenced_characters_006.control
Sem_B010504_match_referenced_characters_007.control
Sem_B010505_pattern_compatibility_001.control
Sem_B010506_case_sensitive_pattern_matching_001.control
Sem_B010506_case_sensitive_pattern_matching_002.control
......
No preview for this file type
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