conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 06_types_and_values / 0603_type_compatibility / 060303_component_types / NegSem_060303_component_types_001.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Adrien Kirjak – initial implementation
10 *
11 ** @version 0.0.1
12 ** @purpose 1:6.3.3, Ensure that the IUT correctly handles component incompatibility due to differing list of constant definitions
13 ** @verdict pass reject
14 ***************************************************/
15
16 module NegSem_060303_component_types_001 {
17
18 type integer ConstrainedInteger(0..10);
19
20 type component TestCaseComp {
21 const integer c_integer:=2;
22 }
23
24 type component FunctionComp {
25 const integer c_integer:=2;
26 const ConstrainedInteger c_constrained:=2;
27 }
28
29 function f_testFunction(integer p_arg) runs on FunctionComp return integer {
30
31 var integer v_result;
32 v_result:=p_arg*c_integer;
33 return v_result;
34 }
35
36 testcase TC_NegSem_060303_component_types_001() runs on TestCaseComp {
37
38 var integer v_int:=1;
39
40 v_int := f_testFunction(v_int);
41 // runs on mtc with type TestCaseComp
42 // f_testFunction needs to run on FunctionComp
43 // which has 2 variables not 1 as TestCaseComp
44 setverdict (fail, "ERROR expected: function runs on mtc with type TestCaseComp f_testFunction needs to run on FunctionComp which has 2 variables not 1 as TestCaseComp");
45 }
46
47 control {
48 execute(TC_NegSem_060303_component_types_001());
49 }
50
51 }
This page took 0.033077 seconds and 5 git commands to generate.