conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 06_types_and_values / 0603_type_compatibility / 060303_component_types / Sem_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 assignments from structures having compatible components
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 module Sem_060303_component_types_001 {
17
18 type integer ConstrainedInteger(0..10);
19
20 type component TestCaseComp {
21 const integer c_integer:=2;
22 const ConstrainedInteger c_constrained:=2;
23 }
24
25 type component FunctionComp {
26 const integer c_integer:=2;
27 const ConstrainedInteger c_constrained:=2;
28 }
29
30 function f_testFunction(integer p_arg) runs on FunctionComp return integer {
31
32 var integer v_result;
33 v_result:=p_arg*c_integer*c_constrained;
34 return v_result;
35 }
36
37 testcase TC_Sem_060303_component_types_001() runs on TestCaseComp {
38
39 var integer v_int:=1;
40
41 if ( f_testFunction(v_int)==4 ) {
42 setverdict(pass);
43 }
44 else {
45 setverdict(fail);
46 }
47 }
48
49 control {
50 execute(TC_Sem_060303_component_types_001());
51 }
52
53 }
This page took 0.040942 seconds and 5 git commands to generate.