Sem_190302_select_union_statement_005.ttcn 1.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:19.3.2, verify that no branch is executed if the's no suitable case branch
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// Otherwise [if no case exists for the chosen alternative and the else branch 
// is not present], the select union statement has no effect.

12
module Sem_190302_select_union_statement_005 { 
13
14
15
16
17
18
19
20
21
22
23

    type component GeneralComp {
	}	
    
    type union U {
        integer intOption,
        charstring strOption,
        boolean boolOption,
        bitstring bitOption
    }

24
    testcase TC_Sem_190302_select_union_statement_005() runs on GeneralComp {
25
26
27
28
29
30
31
32
33
34
35
36
        var U v_un := { strOption := "abc" }
        select union (v_un) {
            case (intOption) {
                setverdict(pass);
            } case (bitOption) {
                setverdict(fail);
            }
        }
        setverdict(pass);
	}

	control {
37
		execute(TC_Sem_190302_select_union_statement_005());
38
39
	}
}