Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that predefined decvalue and decvalue_unichar function works properly in case of uninitialized encode value is given
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/* The following requirements are tested:
* all actual in and inout parameters shall be initialized with the following exceptions:
* 16.1.2. Restriction a.3 : the encoded_value parameter of the decvalue and decvalue_unichar function may be uninitialized.*/
//NOTE: uninitialized value for encoded_value parameter decvalue() input is not working with TestCast 6.8.2.5
module Sem_160102_predefined_functions_080 {
type enumerated E { one(1), two(2), three(3) } with { variant "32 bit"};
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_080 () runs on GeneralComp {
var bitstring v_test; // uninitialized value for encoded_value parameter decvalue() input
var universal charstring v_test_enc_8; // uninitialized value encoded_value parameter for decvalue_unichar() input
var E v_decoded;
var E v_decoded_8;
var integer v_res := decvalue(v_test, v_decoded);
var integer v_res_8 := decvalue_unichar(v_test_enc_8, v_decoded_8, "UTF-8");
if(match(v_res,0)){
setverdict(pass,"Decoded ", v_decoded , " with result ", v_res);
}else{
setverdict(fail,"Decode failed ", v_decoded , " with result ", v_res);
}
if(match(v_res_8,0)){
setverdict(pass,"Decoded ", v_decoded_8 , " with result ", v_res_8);
}else{
setverdict(fail,"Decode failed ", v_decoded_8 , " with result ", v_res_8);
}
}
control{
execute(TC_Sem_160102_predefined_functions_080());
}
}