conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 22_communication_operations / 2202_message_based_communication / 220203_trigger_operation / Sem_220203_TriggerOperation_028.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:22.2.3, fuzzy variable in @index redirect
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15
16 // The following requirements are tested:
17 // If a variable referenced in the value, sender or @index clause is a lazy or fuzzy
18 // variable, the expression assigned to this variable is equal to the result produced
19 // by the trigger operation i.e. later evaluation of the lazy or fuzzy variable does not
20 // lead to repeated invocation of the trigger operation.
21
22 module Sem_220203_TriggerOperation_028 {
23 type port P message {
24 inout integer;
25 } with {extension "internal"}
26
27 type component GeneralComp {
28 port P p[2];
29 }
30
31 testcase TC_Sem_220203_TriggerOperation_028() runs on GeneralComp {
32 var @fuzzy integer v_int;
33
34 connect(self:p[1], self:p[1]);
35 p[1].send(1);
36 p[1].send(2);
37 p[1].send(3);
38 any from p.trigger(integer:?) -> @index v_int;
39
40 if (v_int == 1) { // evaluation of @lazy (receive shall not be called again)
41 alt {
42 [] p[1].receive(integer:2) { setverdict(pass); }
43 [] any from p.receive { setverdict(fail); }
44 }
45 } else {
46 setverdict(fail);
47 }
48 }
49
50 control {
51 execute(TC_Sem_220203_TriggerOperation_028(), 5.0);
52 }
53 }
This page took 0.032746 seconds and 5 git commands to generate.