conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 05_basic_language_elements / 0504_parametrization / 050401_formal_parameters / 05040102_parameters_of_kind_template / Sem_05040102_parameters_of_kind_template_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:5.4.1.2, Ensure that the IUT correctly handles parametrization through the use of parameterized templates.
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15 module Sem_05040102_parameters_of_kind_template_001 {
16
17 type enumerated MyEnumeratedType {e_black, e_white}
18 type integer address;
19
20 type record MyRecord {
21 integer field1,
22 integer field2
23 }
24
25 template MyRecord m_parametrizedTemplate(integer p_integer := 5, template integer p_integerTemplate := ? ) := {
26 field1 := p_integer,
27 field2 := p_integerTemplate
28 }
29
30 type component GeneralComp {
31
32 }
33
34
35 testcase TC_Sem_05040102_parameters_of_kind_template_001() runs on GeneralComp {
36
37 var MyRecord DefaultValues := {
38 field1 := 5,
39 field2 := 1 //any number can be used here to correspond with ? matching
40 }
41
42 var MyRecord ModifiedValues := {
43 field1 := 2,
44 field2 := 1
45 }
46
47 if ( match(DefaultValues, m_parametrizedTemplate) and
48 match(ModifiedValues, m_parametrizedTemplate(2,1)))
49 { setverdict(pass);}
50 else
51 { setverdict(fail); }
52
53 }
54
55
56 control{
57 execute(TC_Sem_05040102_parameters_of_kind_template_001());
58 }
59
60 }
This page took 0.032464 seconds and 5 git commands to generate.