conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 06_types_and_values / 0602_structured_types_and_values / 060205_unions / 06020501_referencing_fields_of_union_type / NegSem_06020501_referencing_fields_of_union_type_002.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.2.5.1, unknown union alternative in extended type reference
13 ** @verdict pass reject
14 ***************************************************/
15
16 // The following requirement is tested:
17 // Alternatives of a union type shall be referenced by the dot notation
18 // TypeIdOrExpression.AlternativeId, where TypeIdOrExpression resolves to the name
19 // of a union type or an expression of a union type such as variable, formal
20 // parameter, module parameter, constant, template, or function invocation.
21 // AlternativeId shall resolve to the name of an alternative in the union type.
22
23 module NegSem_06020501_referencing_fields_of_union_type_002 {
24 type component GeneralComp {
25 }
26
27 type union U {
28 integer option1,
29 charstring option2
30 }
31
32 type U.option3 UnionItem;
33
34 testcase TC_NegSem_06020501_referencing_fields_of_union_type_002() runs on GeneralComp {
35 var UnionItem v_val := 1;
36 if (v_val == 1) { setverdict(pass); }
37 else { setverdict(fail); }
38 }
39
40 control{
41 execute(TC_NegSem_06020501_referencing_fields_of_union_type_002());
42 }
43 }
This page took 0.032362 seconds and 5 git commands to generate.