Commit 43148e96 authored by ebensza's avatar ebensza Committed by Gerrit Code Review
Browse files

Merge "Added tests / minor fixes"

parents e9cc7f1a d4578e84
......@@ -310,6 +310,320 @@ error: There is no local or imported definition with name `v_statement'
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_050202_Uniqueness_001 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles the uniqueness of variable names in its scope >
<COMPILE>
<MODULE TTCN NegSem_050202_Uniqueness_001 NegSem_050202_Uniqueness_001.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope
** @verdict pass reject
***************************************************/
module NegSem_050202_Uniqueness_001 {
type component GeneralComp {
const integer cl_int := 0;
}
testcase TC_NegSem_050202_Uniqueness_001() runs on GeneralComp {
const integer cl_int := 0;
}
control {
execute(TC_NegSem_050202_Uniqueness_001());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Definition with identifier `cl_int' is not unique in the scope hierarchy
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_050202_Uniqueness_004 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles the uniqueness of variable names in its scope >
<COMPILE>
<MODULE TTCN NegSem_050202_Uniqueness_004 NegSem_050202_Uniqueness_004.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope
** @verdict pass reject
***************************************************/
module NegSem_050202_Uniqueness_004 {
const integer c_int := 0;
type component GeneralComp {
}
function f_funcScope() {}
testcase TC_NegSem_050202_Uniqueness_004() runs on GeneralComp {
const integer c_int := 0;
f_funcScope();
}
control {
execute(TC_NegSem_050202_Uniqueness_004());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Definition with identifier `c_int' is not unique in the scope hierarchy
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_050202_Uniqueness_005 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles the uniqueness of variable names in its scope >
<COMPILE>
<MODULE TTCN NegSem_050202_Uniqueness_005 NegSem_050202_Uniqueness_005.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope
** @verdict pass reject
***************************************************/
module NegSem_050202_Uniqueness_005 {
const integer c_int := 0;
type component GeneralComp {
}
function f_funcScope() {
const integer c_int := 0;
}
testcase TC_NegSem_050202_Uniqueness_005() runs on GeneralComp {
f_funcScope();
}
control {
execute(TC_NegSem_050202_Uniqueness_005());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Definition with identifier `c_int' is not unique in the scope hierarchy
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_050202_Uniqueness_006 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles the uniqueness of variable names in its scope >
<COMPILE>
<MODULE TTCN NegSem_050202_Uniqueness_006 NegSem_050202_Uniqueness_006.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope
** @verdict pass reject
***************************************************/
module NegSem_050202_Uniqueness_006 {
type component GeneralComp {
const integer repeatedIdentifier := 0;
}
testcase TC_NegSem_050202_Uniqueness_006() runs on GeneralComp {
var boolean repeatedIdentifier := true;
}
control {
execute(TC_NegSem_050202_Uniqueness_006());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Definition with identifier `repeatedIdentifier' is not unique in the scope hierarchy
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_050202_Uniqueness_007 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles the uniqueness of variable names in its scope >
<COMPILE>
<MODULE TTCN NegSem_050202_Uniqueness_007 NegSem_050202_Uniqueness_007.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope
** @verdict pass reject
***************************************************/
module NegSem_050202_Uniqueness_007 {
type component GeneralComp {
const integer repeatedIdentifier := 0;
}
function f_funcScope() runs on GeneralComp {
var boolean repeatedIdentifier := true;
}
testcase TC_NegSem_050202_Uniqueness_007() runs on GeneralComp {
f_funcScope();
}
control {
execute(TC_NegSem_050202_Uniqueness_007());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Definition with identifier `repeatedIdentifier' is not unique in the scope hierarchy
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_050202_Uniqueness_008 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles the uniqueness of variable names in its scope >
<COMPILE>
<MODULE TTCN NegSem_050202_Uniqueness_008 NegSem_050202_Uniqueness_008.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope
** @verdict pass reject
***************************************************/
module NegSem_050202_Uniqueness_008 {
type component GeneralComp {
}
function f_funcScope(boolean repeatedIdentifier) {
const integer repeatedIdentifier := 0;
}
testcase TC_NegSem_050202_Uniqueness_008() runs on GeneralComp {
var boolean v_boolean := true;
f_funcScope(v_boolean);
}
control {
execute(TC_NegSem_050202_Uniqueness_008());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Definition with identifier `repeatedIdentifier' is not unique in the scope hierarchy
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_050202_Uniqueness_009 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles the uniqueness of variable names in its scope >
<COMPILE>
<MODULE TTCN NegSem_050202_Uniqueness_009 NegSem_050202_Uniqueness_009.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope
** @verdict pass reject
***************************************************/
module NegSem_050202_Uniqueness_009 {
const integer repeatedIdentifier := 0;
type component GeneralComp {
}
function f_funcScope() {}
testcase TC_NegSem_050202_Uniqueness_009() runs on GeneralComp {
var boolean repeatedIdentifier := true;
f_funcScope();
}
control {
execute(TC_NegSem_050202_Uniqueness_009());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Definition with identifier `repeatedIdentifier' is not unique in the scope hierarchy
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_050202_Uniqueness_010 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Ensure that the IUT correctly handles the uniqueness of variable names in its scope >
<COMPILE>
<MODULE TTCN NegSem_050202_Uniqueness_010 NegSem_050202_Uniqueness_010.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope
** @verdict pass reject
***************************************************/
module NegSem_050202_Uniqueness_010 {
const integer repeatedIdentifier := 0;
type component GeneralComp {
}
function f_funcScope() {
var boolean repeatedIdentifier := true;
}
testcase TC_NegSem_050202_Uniqueness_010() runs on GeneralComp {
f_funcScope();
}
control {
execute(TC_NegSem_050202_Uniqueness_010());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: Definition with identifier `repeatedIdentifier' is not unique in the scope hierarchy
<END_RESULT>
<END_TC>
:exmp
.*---------------------------------------------------------------------*
:h2. 0503_ordering_of_declarations folder
.*---------------------------------------------------------------------*
......
......@@ -54,7 +54,7 @@ This TD contains negative tests from ETSI TTCN3 Conformance Test's 06_types_and_
.*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
:h3. NegSem_0501_Identifier_001 negative test
:h3. NegSyn_060100_SimpleBasicTypes_001 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -62,7 +62,7 @@ This TD contains negative tests from ETSI TTCN3 Conformance Test's 06_types_and_
<COMPILE>
<MODULE TTCN NegSem_0501_Identifier_001 NegSem_0501_Identifier_001.ttcn >
<MODULE TTCN NegSyn_060100_SimpleBasicTypes_001 NegSyn_060100_SimpleBasicTypes_001.ttcn >
/***************************************************
** @version 0.0.1
** @purpose 1:6.1.0, Assign float to integer values
......@@ -81,7 +81,7 @@ error: integer value was expected
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_0501_Identifier_002 negative test
:h3. NegSyn_060100_SimpleBasicTypes_002 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -89,7 +89,7 @@ error: integer value was expected
<COMPILE>
<MODULE TTCN NegSem_0501_Identifier_002 NegSem_0501_Identifier_002.ttcn >
<MODULE TTCN NegSyn_060100_SimpleBasicTypes_002 NegSyn_060100_SimpleBasicTypes_002.ttcn >
/***************************************************
** @version 0.0.1
** @purpose 1:6.1.0, Assign boolean to integer values
......@@ -108,7 +108,7 @@ error: integer value was expected
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_0501_Identifier_003 negative test
:h3. NegSyn_060100_SimpleBasicTypes_003 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -116,7 +116,7 @@ error: integer value was expected
<COMPILE>
<MODULE TTCN NegSem_0501_Identifier_003 NegSem_0501_Identifier_003.ttcn >
<MODULE TTCN NegSyn_060100_SimpleBasicTypes_003 NegSyn_060100_SimpleBasicTypes_003.ttcn >
/***************************************************
** @version 0.0.1
** @purpose 1:6.1.0, Assign integer to float values
......@@ -135,7 +135,7 @@ error: float value was expected
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_0501_Identifier_004 negative test
:h3. NegSyn_060100_SimpleBasicTypes_004 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -143,7 +143,7 @@ error: float value was expected
<COMPILE>
<MODULE TTCN NegSem_0501_Identifier_004 NegSem_0501_Identifier_004.ttcn >
<MODULE TTCN NegSyn_060100_SimpleBasicTypes_004 NegSyn_060100_SimpleBasicTypes_004.ttcn >
/***************************************************
** @version 0.0.1
** @purpose 1:6.1.0, Assign boolean to float values
......@@ -162,7 +162,7 @@ error: float value was expected
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_0501_Identifier_005 negative test
:h3. NegSyn_060100_SimpleBasicTypes_005 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -170,7 +170,7 @@ error: float value was expected
<COMPILE>
<MODULE TTCN NegSem_0501_Identifier_005 NegSem_0501_Identifier_005.ttcn >
<MODULE TTCN NegSyn_060100_SimpleBasicTypes_005 NegSyn_060100_SimpleBasicTypes_005.ttcn >
/***************************************************
** @version 0.0.1
** @purpose 1:6.1.0, Assign verdicttype to float values
......@@ -189,7 +189,7 @@ error: float value was expected
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_0501_Identifier_006 negative test
:h3. NegSyn_060100_SimpleBasicTypes_006 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -197,7 +197,7 @@ error: float value was expected
<COMPILE>
<MODULE TTCN NegSem_0501_Identifier_006 NegSem_0501_Identifier_006.ttcn >
<MODULE TTCN NegSyn_060100_SimpleBasicTypes_006 NegSyn_060100_SimpleBasicTypes_006.ttcn >
/***************************************************
** @version 0.0.1
** @purpose 1:6.1.0, Assign integer to verdicttype values
......@@ -2142,6 +2142,45 @@ error: "abcyz" is not a valid value for type `charstring' which has subtype patt
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSyn_06010205_StringPattern_001 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Assign values to pattern restricted character strings without @nocase modifier. >
<COMPILE>
<MODULE TTCN NegSyn_06010205_StringPattern_001 NegSyn_06010205_StringPattern_001.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:6.1.2.5, Assign values to pattern restricted character strings without @nocase modifier.
** @verdict pass reject, noexecution
***************************************************/
module NegSyn_06010205_StringPattern_001 {
type charstring MyString (pattern "abc*xyz"); //without @nocase
type component GeneralComp {}
testcase TC_NegSyn_06010205_StringPattern_001() runs on GeneralComp {
var MyString v_c;
v_c := "ABc1234xYz"; //error value is out of constraint: ABc
}
control{
execute(TC_NegSyn_06010205_StringPattern_001());
}
}
<END_MODULE>
<RESULT COUNT 1>
error: "ABc1234xYz" is not a valid value for type `charstring' which has subtype pattern\(abc\*xyz\)
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSyn_06010205_StringPattern_002 negative test
.*---------------------------------------------------------------------*
......@@ -4409,7 +4448,7 @@ error: union value was expected for type `@NegSem_060205_top_level_005.U'
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_060205_top_level_005 negative test
:h3. NegSyn_060205_top_level_001 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -5009,7 +5048,7 @@ error: Type `address' is not defined in this module
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_060206_anytype_002 negative test
:h3. NegSyn_060206_anytype_002 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -5017,7 +5056,7 @@ error: Type `address' is not defined in this module
<COMPILE>
<MODULE TTCN NegSem_060206_anytype_002 NegSem_060206_anytype_002.ttcn >
<MODULE TTCN NegSyn_060206_anytype_002 NegSyn_060206_anytype_002.ttcn >
/****************************************************
** @version 0.0.1
** @purpose 1:6.2.0.6, ensure that anytype cannot be port type
......
......@@ -1103,6 +1103,54 @@ error: Incompatible explicit type specification: `integer' was expected instead
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_08020301_GeneralFormatOfImport_038 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
<TC - Verify that definition from inside an imported function cannot be referenced >
<COMPILE>
<MODULE TTCN NegSem_08020301_GeneralFormatOfImport_038 NegSem_08020301_GeneralFormatOfImport_038.ttcn >
/******************************************************************************
** @version 0.0.1
** @purpose 1:8.2.3.1, Verify that definition from inside an imported function cannot be referenced
** @verdict pass reject
*****************************************************************/
// The following requirements are tested:
// Restriction f:
// When importing a function, altstep or test case the corresponding behaviour
// specifications and all definitions used inside the behaviour specifications
// remain invisible for the importing module.
module NegSem_08020301_GeneralFormatOfImport_038 {
import from NegSem_08020301_GeneralFormatOfImport_038_import { function f_test };
// c_test should be undefined, because it is invisible for the importing module
const integer c_test2 := c_test;
}
<END_MODULE>
<MODULE TTCN NegSem_08020301_GeneralFormatOfImport_038_import NegSem_08020301_GeneralFormatOfImport_038_import.ttcn >
module NegSem_08020301_GeneralFormatOfImport_038_import {
function f_test() {
const integer c_test := 1;
}
}
<END_MODULE>
<RESULT COUNT 1>
error: There is no local or imported definition with name `c_test'
<END_RESULT>
<END_TC>
:exmp
*---------------------------------------------------------------------*
:h3. NegSyn_08020301_GeneralFormatOfImport_001 negative test
.*---------------------------------------------------------------------*
......@@ -1715,7 +1763,7 @@ error: There is no local or imported definition with name `c_myconst'
:exmp
*---------------------------------------------------------------------*
:h3. NegSem_080205_VisibilityOfDefinitions_005 negative test
:h3. NegSyn_0803_ModuleControlPart_001 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -1723,7 +1771,7 @@ error: There is no local or imported definition with name `c_myconst'
<COMPILE>
<MODULE TTCN NegSem_080205_VisibilityOfDefinitions_005 NegSem_080205_VisibilityOfDefinitions_005.ttcn >
<MODULE TTCN NegSyn_0803_ModuleControlPart_001 NegSyn_0803_ModuleControlPart_001.ttcn >
/*****************************************************************
** @version 0.0.1
** @purpose 1:8.3, Ensure that there is not more than one control part.
......@@ -2936,7 +2984,7 @@ error: at or before token `1.0': syntax error, unexpected FloatValue, expecting
:h2. 14_procedure_signatures folder
.*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
:h3. egSem_1400_procedure_signatures_001 negative test
:h3. NegSem_1400_procedure_signatures_001 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -2944,7 +2992,7 @@ error: at or before token `1.0': syntax error, unexpected FloatValue, expecting
<COMPILE>
<MODULE TTCN egSem_1400_procedure_signatures_001 egSem_1400_procedure_signatures_001.ttcn >
<MODULE TTCN NegSem_1400_procedure_signatures_001 NegSem_1400_procedure_signatures_001.ttcn >
/*****************************************************************
** @version 0.0.1
** @purpose 1:22.3.1, Ensure that nonblocking signature contains in parameter
......@@ -3006,7 +3054,7 @@ error: A non-blocking signature cannot have `out' parameter
:exmp
*---------------------------------------------------------------------*
:h3. egSem_1400_procedure_signatures_002 negative test
:h3. NegSem_1400_procedure_signatures_002 negative test
.*---------------------------------------------------------------------*
:xmp tab=0.
......@@ -3014,7 +3062,7 @@ error: A non-blocking signature cannot have `out' parameter
<COMPILE>
<MODULE TTCN egSem_1400_procedure_signatures_002 egSem_1400_procedure_signatures_002.ttcn >
<MODULE TTCN NegSem_1400_procedure_signatures_002 NegSem_1400_procedure_signatures_002.ttcn >
/*****************************************************************
** @version 0.0.1
** @purpose 1:14, Ensure that blocking calls needs response or exception handling
......