conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 10_constants / NegSem_10_Constants_005.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:10, Ensure that index notation of a field in a set of type, which actual value is null shall cause an error
13 ** @verdict pass reject
14 ***************************************************/
15
16 /* The following requirements are tested:
17 Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an
18 error.
19 */
20
21 module NegSem_10_Constants_005 {
22
23 type integer address;
24 type default MyDef;
25 type set of address MySetofInt;
26
27 type component GeneralComp {
28 }
29
30 testcase TC_NegSem_10_Constants_005() runs on GeneralComp {
31
32 var MySetofInt R1:= {[0] := null};
33 var MyDef R2:= null;
34
35 const default C2 := R2; //allowed
36 const integer C1 := R1[0]; //error
37
38 if (match(C1,R1[0])) { setverdict(pass,"match") }
39 else { setverdict(fail) }
40 }
41
42 control{
43 execute(TC_NegSem_10_Constants_005());
44 }
45 }
This page took 0.037029 seconds and 5 git commands to generate.