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:5.5, Verify that cyclic import containing cyclic function calls is allowed
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
16 // The following requirements are tested:
17 // Direct and indirect cyclic definitions are not allowed with the exception of the
19 // a) for recursive type definitions (see clause 6.2);
20 // b) function and altstep definitions (i.e. recursive function or altstep calls);
21 // c) cyclic import definitions, if the imported definitions only form allowed cyclic
23 // In particular, the combination of c and b is tested
25 module Sem_0505_cyclic_definitions_003 {
26 import from Sem_0505_cyclic_definitions_003_import { function f_factImp; }
27 type component GeneralComp {
30 function f_fact(integer p_argument) return integer {
35 return p_argument*f_factImp(p_argument-1);
39 testcase TC_Sem_0505_cyclic_definitions_003() runs on GeneralComp {
40 if (f_fact(10) == 3628800) { // checks 10!
49 execute(TC_Sem_0505_cyclic_definitions_003());