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:21.3.8, Verify any from killed index redirection to fuzzy variable
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15 // The following requirements are tested:
17 // If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression
18 // assigned to this variable is equal to the result produced by the killed operation. Later
19 // evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the
21 module Sem_210308_killed_operation_012 {
23 type component GeneralComp {}
25 function f(float p_time) runs on GeneralComp {
31 testcase TC_Sem_210308_killed_operation_012() runs on GeneralComp system GeneralComp {
32 const integer c_size := 4;
33 var GeneralComp v_ptc[c_size];
34 var @fuzzy integer v_index;
36 for (var integer i := 0; i < c_size; i := i + 1) {
37 v_ptc[i] := GeneralComp.create; // created components are inactive
38 if (i == 2) { v_ptc[i].start(f(1.0)); }
39 else { v_ptc[i].start(f(100.0)); }
45 [] any from v_ptc.killed -> @index v_index {
46 v_ptc[0].kill; // component at position 0 is killed after the redirect assignment
47 if(v_index == 2){ // no killed call during evaluation, v_index remains equal to 2
50 setverdict(fail, "Index incorrectly assigned");
53 [else] { setverdict(fail, "The any from killed operation didn't found killed component"); }
58 execute(TC_Sem_210308_killed_operation_012(), 5.0);