conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 05_basic_language_elements / 0504_parametrization / 050402_actual_parameters / NegSem_050402_actual_parameters_095.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:5.4.2, verify that referencing errors are detected in actual parameters passed to out formal template parameters
13 ** @verdict pass reject
14 ***************************************************/
15
16 // The following requirement is tested:
17 // When actual parameters that are passed to inout and out formal value or template
18 // parameters contain a value or template reference, rules for using references on
19 // the left hand side of assignments apply.
20
21 module NegSem_050402_actual_parameters_095 {
22
23 type component GeneralComp {
24 }
25
26 type record R {
27 integer field1,
28 record {
29 integer subfield1,
30 integer subfield2
31 } field2 optional
32 }
33
34 function f_test(out template integer p_val) {
35 p_val := 10;
36 }
37
38 testcase TC_NegSem_050402_actual_parameters_095() runs on GeneralComp {
39 var template R v_rec := {
40 field1 := 1,
41 field2 := ({ subfield1 := 0, subfield2 := 1}, { subfield1 := 2, subfield2 := 3 })
42 };
43 f_test(v_rec.field2.subfield1); // tested parameter passing (using referencing rules specified at 15.6.2)
44 if (valueof(v_rec.field2.subfield1) == 10 and match(0, v_rec.field2.subfield2)) { setverdict(pass); }
45 else { setverdict(fail); }
46
47 }
48
49 control {
50 execute(TC_NegSem_050402_actual_parameters_095());
51 }
52 }
This page took 0.037478 seconds and 5 git commands to generate.