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
9 * Adrien Kirjak – initial implementation
12 ** @purpose 1:6.2.4, explicit numbering of enumerated items
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
16 // The following requirement is tested:
17 // For each enumerated value without an assigned integer value, the system
18 // successively associates an integer number in the textual order of the
19 // enumerated values, starting at the left-hand side, beginning with zero, by
20 // step 1 and skipping any number occupied by any of the enumerated values with
21 // a manually assigned value. These values are only used by the system to allow
22 // the use of relational operators. The user shall not directly use associated
23 // integer values but can access them and convert integer values into enumerated
24 // values by using the predefined functions enum2int and int2enum (see clauses
25 // 16.1.2, C.1.29 C.1.30 and C.1.4 C.1.4).
27 module Sem_060204_enumerated_type_and_values_003 {
29 type component GeneralComp {
32 type enumerated EDays {
33 Monday(-1), Tuesday(4), Wednesday(0), Thursday(6), Friday(20)
36 testcase TC_Sem_060204_enumerated_type_and_values_003() runs on GeneralComp {
37 var EDays v_day0 := Monday, v_day2 := Wednesday, v_day4 := Friday;
39 if (enum2int(v_day0) == -1 and enum2int(v_day2) == 0 and enum2int(v_day4) == 20) {
47 execute(TC_Sem_060204_enumerated_type_and_values_003());