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_027.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 sender 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_027 {
23 type integer address;
24
25 type port P message {
26 inout integer;
27 } with {extension "internal"}
28
29 type component GeneralComp {
30 port P p;
31 }
32
33 testcase TC_Sem_220203_TriggerOperation_027() runs on GeneralComp {
34 var @fuzzy address v_addr;
35
36 connect(self:p, self:p);
37 p.send(1) to 1;
38 p.send(2) to 2;
39 p.send(3) to 3;
40 p.trigger(integer:?) -> sender v_addr;
41
42 if (v_addr == 1) { // evaluation of @lazy (receive shall not be called again)
43 alt {
44 [] p.receive(integer:2) { setverdict(pass); }
45 [] p.receive { setverdict(fail); }
46 }
47 } else {
48 setverdict(fail);
49 }
50 }
51
52 control {
53 execute(TC_Sem_220203_TriggerOperation_027(), 5.0);
54 }
55 }
This page took 0.035405 seconds and 5 git commands to generate.