Commit 122e6d71 authored by balaskoa's avatar balaskoa
Browse files

RAW_repeat tests have been added (not run yet)


Signed-off-by: default avatarbalaskoa <Jeno.Balasko@ericsson.com>
Change-Id: I24788c5191ba783dd64f0f842a31a9cd206ab3c6
parent d4a4bde5
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
#TrecofOper.tc_empty_record_element #DTE, unrecoverable (config file is necessary!) #TrecofOper.tc_empty_record_element #DTE, unrecoverable (config file is necessary!)
#TrecofOper.tc_empty_record_element2 #DTE, unrecoverable #TrecofOper.tc_empty_record_element2 #DTE, unrecoverable
#record_test.tc_REC_string2ttcn_empty #fail, setting: nolegacy!!! #record_test.tc_REC_string2ttcn_empty #fail, setting: nolegacy!!!
#RAW/RAW_repeat:
#RAW_repeat #TODO: 1 pass, 2 fail, see Bug 568518
#ucharstrOper: #ucharstrOper:
#cstr_content.tc_unichar_utf8_var_hungarian_text #fails if the file is not UTF-8 but ISO #cstr_content.tc_unichar_utf8_var_hungarian_text #fails if the file is not UTF-8 but ISO
#Annex_E_variants.tc_utf8 #Annex_E_variants.tc_utf8
......
...@@ -256,12 +256,15 @@ Test.control ...@@ -256,12 +256,15 @@ Test.control
HS16977_Test.control HS16977_Test.control
#RAW/IntX #RAW/IntX
IntX.control #ok! 6 pass IntX.control #ok! 6 pass
#RAW/Lengthto_Offset #RAW/Lengthto_Offset:
Lengthto_Offset Lengthto_Offset
#RAW/RAW_bitstring_test #RAW/RAW_bitstring_test:
RAW_bitstring_test RAW_bitstring_test
#RAW/RAW_integer_test #RAW/RAW_EncDec see in [ORDERED_INCLUDE]
#RAW/RAW_integer_test:
RAW_integer_test RAW_integer_test
#RAW/RAW_repeat:
#RAW_repeat #TODO: 1pass, 2 fail, see Bug 568518
#RAW/ustr #RAW/ustr
ustr.control ustr.control
RAWCodingAttributes.control RAWCodingAttributes.control
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
#"src/EncodeDecode/XER_EncDec/XER_EncDec.cfg" #"src/EncodeDecode/XER_EncDec/XER_EncDec.cfg"
#"src/text2ttcn_nolegacy/text2ttcn_1.cfg" #"src/text2ttcn_nolegacy/text2ttcn_1.cfg"
#"src/map_param/single_mode/single.cfg" #3 pass #"src/map_param/single_mode/single.cfg" #3 pass
"src/references/references.cfg" #"src/references/references.cfg"
#"src/EncodeDecode/RAW/RAW_repeat/RAW_repeat_test.cfg"
[EXECUTE] [EXECUTE]
#### EncodeDecode folder ##### #### EncodeDecode folder #####
#all_from_with_functions #all_from_with_functions
...@@ -57,6 +58,8 @@ ...@@ -57,6 +58,8 @@
#JsonBasicAttributeTest.tc_rec_attr_metainfo_int #JsonBasicAttributeTest.tc_rec_attr_metainfo_int
#JsonBasicAttributeTest.tc_rec_attr_metainfo_nameas #JsonBasicAttributeTest.tc_rec_attr_metainfo_nameas
#JsonBasicAttributeTest #JsonBasicAttributeTest
#RAW/RAW_repeat
#RAW_repeat #TODO: 1pass, 2 fail, see Bug 568518
[LOGGING] [LOGGING]
# In this section you can specify the name of the log file and the classes of events # In this section you can specify the name of the log file and the classes of events
......
[LOGGING]
LogFile := "%e.%h-%r.%s"
FileMask := LOG_ALL | DEBUG | MATCHING
ConsoleMask := ERROR | WARNING | TESTCASE | STATISTICS | PORTEVENT
LogSourceInfo := Yes
AppendFile := No
TimeStampFormat := DateTime
LogEventTypes := Yes
SourceInfoFormat := Single
LogEntityName := Yes
[EXECUTE]
RAW_repeat_test.control
[MAIN_CONTROLLER]
TCPPort := 0
KillTimer := 10.0
# NumHCs := 0
# LocalAddress :=
/******************************************************************************
* Copyright (c) 2000-2020 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Szalai, Gabor -first draft
* Balasko, Jeno -second version
******************************************************************************/
// This test is based on Bug 568518, reported in Bugzilla at 2020.11.04
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=568518
module RAW_repeat_test {
type component CT {}
type octetstring OCT1 length(1)
type record IE1{
OCT1 ie_type,
integer len,
octetstring data
} with {
variant "PRESENCE(ie_type = '01'O)"
variant (len) "LENGTHTO(data)"
}
type record IE2{
OCT1 ie_type,
integer len,
octetstring data
} with {
variant "PRESENCE(ie_type = '02'O)"
variant (len) "LENGTHTO(data)"
}
type record unknown_IE{
OCT1 ie_type,
integer len,
octetstring data
} with {
variant (len) "LENGTHTO(data)"
}
type record of unknown_IE unknown_IE_list
type set PDU{
IE1 ie1_field,
IE2 ie2_field optional,
unknown_IE_list unknown_ies optional
} with {
variant (unknown_ies) "REPEATABLE(yes)"
}
external function dec_PDU_backtrack(in octetstring stream, out PDU pdu) return integer
with { extension "prototype(backtrack) decode(RAW)" }
// no spread record of
testcase tc_1() runs on CT {
var octetstring stream;
var PDU pdu_decoded;
var PDU pdu_expected := {
ie1_field := { ie_type := '01'O, len:=1, data := '00'O },
ie2_field := { ie_type := '02'O, len:=1, data := '00'O },
unknown_ies := {
{ ie_type := '03'O, len:=1, data := '00'O},
{ ie_type := '04'O, len:=1, data := '00'O}
}
}
var integer result;
stream := '010100020100030100040100'O // IE1, IE2, unknown IE
result:=dec_PDU_backtrack(stream,pdu_decoded);
log(stream);
log(result) // { ie1_field := { ie_type := '01'O, len := 1, data := '00'O }, ie2_field := { ie_type := '02'O, len := 1, data := '00'O }, unknown_ies := { { ie_type := '03'O, len := 1, data := '00'O }, { ie_type := '04'O, len := 1, data := '00'O } } }
log(pdu_decoded);
if (result != 0) {
setverdict(fail, "decoding failed");
} else if ( pdu_decoded != pdu_expected) {
setverdict(fail,"Unexpected decoding result:");
log("Expected:", pdu_expected);
log("Got :", pdu_decoded);
} else {
setverdict(pass)
}
}
// spread record of
testcase tc_2() runs on CT {
var octetstring stream := '010100030100020100040100'O // IE1, unknown IE, IE2 -> IE2 added to the unknown_ies
var PDU pdu_decoded;
var PDU pdu_expected := {
ie1_field := { ie_type := '01'O, len:=1, data := '00'O },
ie2_field := { ie_type := '02'O, len:=1, data := '00'O },
unknown_ies := {
{ ie_type := '03'O, len:=1, data := '00'O},
{ ie_type := '04'O, len:=1, data := '00'O}
}
}
var integer result;
// stream := '010100030100020100040100'O // IE1, unknown IE, IE2 -> IE2 added to the unknown_ies
result:=dec_PDU_backtrack(stream,pdu_decoded);
log(stream)
log(result) // { ie1_field := { ie_type := '01'O, len := 1, data := '00'O }, ie2_field := omit, unknown_ies := { { ie_type := '03'O, len := 1, data := '00'O }, { ie_type := '02'O, len := 1, data := '00'O }, { ie_type := '04'O, len := 1, data := '00'O } } }
log(pdu_decoded)
if (result != 0) {
setverdict(fail, "decoding failed");
} else if ( pdu_decoded != pdu_expected) {
setverdict(fail,"Unexpected decoding result:");
log("Expected:", pdu_expected);
log("Got :", pdu_decoded);
} else {
setverdict(pass)
}
}
// spread record of
testcase tc_3() runs on CT {
var octetstring stream := '010100030100020100020100040100020100'O; // IE1, unknown IE, IE2 , IE2, unknown IE, IE2 which should be at the unknown_ies list. The ie2_field is not repeatable
var PDU pdu_decoded;
var PDU pdu_expected := {
ie1_field := { ie_type := '01'O, len:=1, data := '00'O },
ie2_field := { ie_type := '02'O, len:=1, data := '00'O },
unknown_ies := {
{ ie_type := '03'O, len:=1, data := '00'O},
{ ie_type := '02'O, len:=1, data := '00'O},
{ ie_type := '04'O, len:=1, data := '00'O},
{ ie_type := '02'O, len:=1, data := '00'O}
}
}
var integer result;
result:=dec_PDU_backtrack(stream,pdu_decoded);
log(stream)
log(result) // { ie1_field := { ie_type := '01'O, len := 1, data := '00'O }, ie2_field := omit, unknown_ies := { { ie_type := '03'O, len := 1, data := '00'O }, { ie_type := '02'O, len := 1, data := '00'O }, { ie_type := '04'O, len := 1, data := '00'O } } }
log(pdu_decoded)
if (result != 0) {
setverdict(fail, "decoding failed");
} else if ( pdu_decoded != pdu_expected) {
setverdict(fail,"Unexpected decoding result:");
log("Expected:", pdu_expected);
log("Got :", pdu_decoded);
} else {
setverdict(pass)
}
}
control{
execute(tc_1());
execute(tc_2());
execute(tc_3());
}
} with {
encode "RAW"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment