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
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that predefined function for removing Byte order mark works properly
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/* The following requirements are tested:
* check that reomve_bom() function successfully removes the byte order mark present at the beginning of a stream of serialized (encoded) universal character strings
UCS encoding scheme
*/
module Sem_160102_predefined_functions_082 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_082 () runs on GeneralComp {
var octetstring v_test_1 :='FEFF0AC2'O ;
var octetstring v_test_2 :='C0'O ;
var octetstring v_remove := remove_bom(v_test_1); // expected result: v_remove := '0AC2'O
var octetstring v_remove_2 := remove_bom(v_test_2); // expected result: v_remove := 'C0'O
if (match(v_remove,'0AC2'O) and match(v_remove_2, 'C0'O)) {
setverdict(pass,"Results are: ",v_remove, " and ",v_remove_2 );
} else {
setverdict(fail,"Failed,the results are: ",v_remove, " and ",v_remove_2, "Expected: '0AC2'O and 'C0'O");
}
}
control{
execute(TC_Sem_160102_predefined_functions_082());
}
}