Skip to content
Snippets Groups Projects
Commit a23e629a authored by Kristof Szabados's avatar Kristof Szabados Committed by GitHub
Browse files

Merge pull request #109 from eadrkir/master

Added/Corrected tests
parents 6be6540f 11152f4f
No related branches found
No related tags found
No related merge requests found
Showing
with 142 additions and 55 deletions
......@@ -5297,7 +5297,7 @@ module NegSyn_06020502_option_and_union_001 {
<END_MODULE>
<RESULT COUNT 1>
error: at or before token `optional': syntax error, unexpected OptionalKeyword, expecting '\}' or ','
error: at or before token `optional': syntax error, unexpected OptionalKeyword, expecting ',' or '\}'
<END_RESULT>
<END_TC>
......
......@@ -736,34 +736,6 @@ error: Right operand of operation `&' should be a string, `record of' or `set of
:h2. 08_modules folder
.*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
:h3. NegSyn_0801_DefinitionOfAModule_001 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - 0801_001 Ensure that a module definition with multiple language specifications is rejected. >
<COMPILE>
<MODULE TTCN NegSyn_0801_DefinitionOfAModule_001 NegSyn_0801_DefinitionOfAModule_001.ttcn >
/*****************************************************************
** @version 0.0.1
** @purpose 1:8.1, Ensure that a module definition with multiple language specifications is rejected.
** @verdict pass reject
*****************************************************************/
// list of languages is not allowed
module NegSyn_0801_DefinitionOfAModule_001 language "TTCN-3:2005", "TTCN-3:2009", "TTCN-3:2010" {
}
<END_MODULE>
<RESULT COUNT 1>
error: at or before token `,': syntax error, unexpected ',', expecting '\{'
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_08020301_GeneralFormatOfImport_002 negative test
.*---------------------------------------------------------------------*
......@@ -3041,7 +3013,7 @@ module NegSyn_12_toplevel_timer_007 {
<END_MODULE>
<RESULT COUNT 1>
error: at or before token `1.0': syntax error, unexpected FloatValue, expecting '\}' or ','
error: at or before token `1.0': syntax error, unexpected FloatValue, expecting ',' or '\}'
<END_RESULT>
<END_TC>
......
......@@ -4398,24 +4398,27 @@ Dynamic test case error: Performing a valueof or send operation on a non-specifi
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - 1510_005 Ensure that the valueof function works correctly on range templates. >
<TC - 1510_005 check that runtime error occurs if valueof is applied to uninitialized template >
<COMPILE>
<EXECUTE_PARALLEL>
<MODULE TTCN NegSem_1510_ValueOfOperation_005 NegSem_1510_ValueOfOperation_005.ttcn >
/*****************************************************************
/******************************************************************************
** @version 0.0.1
** @purpose 1:15.10, Ensure that the valueof function works correctly on range templates.
** @purpose 1:15.10, check that runtime error occurs if valueof is applied to uninitialized template
** @verdict pass reject
*****************************************************************/
***************************************************/
module NegSem_1510_ValueOfOperation_004 {
// The following requirement is tested:
// The template shall be completely initialized and resolve to a specific value.
module NegSem_1510_ValueOfOperation_005 {
type component GeneralComp { }
testcase TC_NegSem_1510_ValueOfOperation_004() runs on GeneralComp {
var template integer v_test := (1..5);
testcase TC_NegSem_1510_ValueOfOperation_005() runs on GeneralComp {
var template integer v_test;
var integer v_second := valueof(v_test);
......@@ -4425,7 +4428,61 @@ module NegSem_1510_ValueOfOperation_004 {
}
control{
execute(TC_NegSem_1510_ValueOfOperation_004());
execute(TC_NegSem_1510_ValueOfOperation_005());
}
}
<END_MODULE>
<RESULT COUNT 1>
Dynamic test case error: Performing a valueof or send operation on a non-specific integer template
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_1510_ValueOfOperation_006 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - 1510_006 check that runtime error occurs if valueof is applied to partially initialized template >
<COMPILE>
<EXECUTE_PARALLEL>
<MODULE TTCN NegSem_1510_ValueOfOperation_006 NegSem_1510_ValueOfOperation_006.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:15.10, check that runtime error occurs if valueof is applied to partially initialized template
** @verdict pass reject
***************************************************/
// The following requirement is tested:
// The template shall be completely initialized and resolve to a specific value.
module NegSem_1510_ValueOfOperation_006 {
type component GeneralComp { }
type record R {
integer field1,
integer field2
}
testcase TC_NegSem_1510_ValueOfOperation_006() runs on GeneralComp {
var template R v_test;
var R v_result;
v_test.field1 := 1; // field2 is left uninitialized
v_result := valueof(v_test);
// if we get here, something must be wrong as valueof on v_test shall cause an error
// as it is not a template.
setverdict(fail);
}
control{
execute(TC_NegSem_1510_ValueOfOperation_006());
}
}
......
......@@ -679,6 +679,60 @@ error: The connection between port types `@NegSem_210101_connect_operation_001.m
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_210101_connect_operation_002 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - 210101_001 Ensure that the the IUT does not allow connecting incompatible ports >
<COMPILE>
<MODULE TTCN NegSem_210101_connect_operation_002 NegSem_210101_connect_operation_002.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:21.1.1, Ensure that the the IUT does not allow connecting incompatible ports
** @verdict pass reject
***************************************************/
//Test the two input port cannot connect
module NegSem_210101_connect_operation_002{
type port myport message {
in integer
} with {extension "internal"}
type component Mysystem
{
port myport messagePort;
}
testcase TC_NegSem_210101_connect_operation_002() runs on Mysystem system Mysystem {
var Mysystem MyCompA;
var Mysystem MyCompB;
MyCompA:=Mysystem.create;
MyCompB:=Mysystem.create;
connect(MyCompB:messagePort, MyCompA:messagePort); //not allowed messageports are output
//connect(self:messagePort, self:messagePort);
messagePort.send(5);
}
control{
execute(TC_NegSem_210101_connect_operation_002());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Port type `@NegSem_210101_connect_operation_002.myport' does not have any outgoing message types
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_210101_map_operation_002 negative test
.*---------------------------------------------------------------------*
......
......@@ -33,29 +33,31 @@ module Sem_060302_structured_types_006 {
var IntegerList v_list1:={0,-};
var ShortIntegerList v_list2;
var RecordType v_rec1;
var UnorderedIntegerList v_ulist1:={1,-};
var ShortUnorderedIntegerList v_ulist2;
var SetType v_set1;
var integer v_matcher[2];
var integer v_matcher[2]; //<-- array unbound assigent is problimatic
v_matcher[0] := 1;
var boolean v_check1;
v_list1:=v_matcher;
v_list2:=v_list1;
log(v_list1);
log(v_matcher);
v_check1 := (v_list2[0]==1);
if ( v_check1 )
v_list1:=v_matcher;
v_list2:=v_list1;
var boolean v_check1 := (v_list2[0]==1);
if ( v_check1 )
{
setverdict(pass);
}
else {
setverdict(fail);
}
//var RecordType v_rec1;
//var UnorderedIntegerList v_ulist1:={1,-};
//var ShortUnorderedIntegerList v_ulist2;
//var SetType v_set1;
}
control{
......
......@@ -26,8 +26,8 @@ module NegSem_210101_connect_operation_002{
MyCompA:=Mysystem.create;
MyCompB:=Mysystem.create;
//connect(MyCompA:messagePort, MyCompB:messagePort); //not allowed messageports are output
connect(self:messagePort, self:messagePort);
connect(MyCompB:messagePort, MyCompA:messagePort); //not allowed messageports are output
//connect(self:messagePort, self:messagePort);
messagePort.send(5);
......
......@@ -784,6 +784,7 @@ Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_001.control
Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_002.control
Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_006.control
Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010.control
Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012.control
Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013.control
Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014.control
Sem_160101_invoking_functions_001.control
......@@ -1304,6 +1305,7 @@ 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_B010205_value_range_008.control
Sem_B010206_superset_001.control
Sem_B010206_superset_002.control
Sem_B010206_superset_003.control
......
......@@ -2044,7 +2044,7 @@
<!-- <FileResource projectRelativePath="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_009.ttcn" relativeURI="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_009.ttcn"/>-->
<FileResource projectRelativePath="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010.ttcn" relativeURI="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010.ttcn"/>
<!-- <FileResource projectRelativePath="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_011.ttcn" relativeURI="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_011.ttcn"/>-->
<!-- <FileResource projectRelativePath="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012.ttcn" relativeURI="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012.ttcn"/>-->
<FileResource projectRelativePath="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012.ttcn" relativeURI="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012.ttcn"/>
<FileResource projectRelativePath="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013.ttcn" relativeURI="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013.ttcn"/>
<FileResource projectRelativePath="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014.ttcn" relativeURI="15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014.ttcn"/>
<!-- <FileResource projectRelativePath="15_templates/15_toplevel/NegSem_15_TopLevel_001.ttcn" relativeURI="15_templates/15_toplevel/NegSem_15_TopLevel_001.ttcn"/>-->
......@@ -3222,7 +3222,7 @@
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_005.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_005.ttcn"/>
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_006.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_006.ttcn"/>
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_007.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_007.ttcn"/>
<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_008.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_008.ttcn"/>-->
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_008.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_008.ttcn"/>
<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_001.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_001.ttcn"/>-->
<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_002.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_002.ttcn"/>-->
<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_003.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_003.ttcn"/>-->
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment