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_009.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, redirect assignment of message fields
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15
16 // The following requirements are tested:
17 // Rules in clause 22.2.2 shall apply.
18 // When the keyword value is followed by an assignment list enframed by a pair of
19 // parentheses, the whole received message and/or one or more parts of it can be
20 // stored. In a single assignment within the list, on the right hand side of the
21 // assignment symbol (":=") a field of the template type shall be referenced, on
22 // the left hand side the name of the variable or a formal parameter, in which
23 // the value shall be stored.
24
25 module Sem_220203_TriggerOperation_009 {
26 type record R
27 {
28 integer field1[2],
29 charstring field2
30 }
31
32 type port P message {
33 inout R;
34 } with {extension "internal"}
35
36 type component GeneralComp
37 {
38 port P p;
39 }
40
41 testcase TC_Sem_220203_TriggerOperation_009() runs on GeneralComp {
42 var integer v_int;
43 var charstring v_str;
44
45 connect(self:p, self:p);
46 p.send(R:{ field1 := { 1, 2 }, field2 := "abc" });
47 alt {
48 [] p.trigger(R:?) -> value ( v_int := field1[1], v_str := field2) {
49 if (v_int == 2 and v_str == "abc") { setverdict (pass); }
50 else { setverdict(fail); }
51 }
52 }
53 }
54
55 control {
56 execute(TC_Sem_220203_TriggerOperation_009(), 5.0);
57 }
58 }
This page took 0.043443 seconds and 5 git commands to generate.