Skip to content
Snippets Groups Projects
Commit eb26a4ae authored by Botond Baranyi's avatar Botond Baranyi
Browse files

RAW enc: fixed octetstring alignment (bug 533767)


Change-Id: I6a37ff8659a8b9fcc350642f14285290dfc2a8c2
Signed-off-by: default avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent c64499b6
No related branches found
No related tags found
No related merge requests found
......@@ -1235,8 +1235,8 @@ int OCTETSTRING::RAW_encode(const TTCN_Typedescriptor_t& p_td,
for (int a = 0; a < blength; a++) bc[a] = val_ptr->octets_ptr[a] << 1;
}
else myleaf.body.leaf.data_ptr = val_ptr->octets_ptr;
if (p_td.raw->endianness == ORDER_MSB) myleaf.align = -align_length;
else myleaf.align = align_length;
if (p_td.raw->endianness == ORDER_MSB) myleaf.align = align_length;
else myleaf.align = -align_length;
return myleaf.length = bl + align_length;
}
......
......@@ -375,9 +375,9 @@ testcase TC_FIELDLENGTH_4_and_BYTEORDER_first_for_octetstring() runs on TempComp
testcase TC_FIELDLENGTH_4_for_octetstring_3_octets_long() runs on TempComp {
const RAW_PDU_18 i := '123456'O
const octetstring o := '12345600'O
const octetstring o := '00123456'O
if ((enc_RAW_PDU_18(i) == o)and(dec_RAW_PDU_18(o) == i & '00'O)) {setverdict(pass);}
if ((enc_RAW_PDU_18(i) == o)and(dec_RAW_PDU_18(o) == '00'O & i)) {setverdict(pass);}
else {setverdict(fail,"enc_RAW_PDU_18(i)= ", enc_RAW_PDU_18(i), "; dec_RAW_PDU_18(o)= ", dec_RAW_PDU_18(o));}
}
......@@ -392,9 +392,9 @@ external function dec_RAW_PDU_19(in octetstring stream) return RAW_PDU_19 with {
testcase TC_FIELDLENGTH_5_for_octetstring_2_octets_long() runs on TempComp {
const RAW_PDU_19 i := '1234'O
const octetstring o := '1234000000'O
const octetstring o := '0000001234'O
if ((enc_RAW_PDU_19(i) == o)and(dec_RAW_PDU_19(o) == i& '000000'O )) {setverdict(pass);}
if ((enc_RAW_PDU_19(i) == o)and(dec_RAW_PDU_19(o) == '000000'O & i)) {setverdict(pass);}
else {setverdict(fail,"enc_RAW_PDU_19(i)= ", enc_RAW_PDU_19(i), "; dec_RAW_PDU_19(o)= ", dec_RAW_PDU_19(o));}
}
......@@ -418,9 +418,9 @@ testcase TC_FIELDLENGTH_4_and_BYTEORDER_last_for_octetstring() runs on TempComp
testcase TC_FIELDLENGTH_4_and_BYTEORDER_last_for_octetstring_3_octets_long() runs on TempComp {
const RAW_PDU_20 i := '123456'O
const octetstring o := '00563412'O
const octetstring o := '56341200'O
if ((enc_RAW_PDU_20(i) == o)and(dec_RAW_PDU_20(o) == i & '00'O)) {setverdict(pass);}
if ((enc_RAW_PDU_20(i) == o)and(dec_RAW_PDU_20(o) == '00'O & i)) {setverdict(pass);}
else {setverdict(fail,"enc_RAW_PDU_20(i)= ", enc_RAW_PDU_20(i), "; dec_RAW_PDU_20(o)= ", dec_RAW_PDU_20(o));}
}
......@@ -2924,9 +2924,9 @@ external function dec_RAW_PDU_132(in octetstring stream) return RAW_PDU_132 with
testcase TC_ALIGN_right_for_octetstring() runs on TempComp{
const RAW_PDU_132 i := '123456'O
const octetstring o := '12345600'O
const octetstring o := '00123456'O
if ((enc_RAW_PDU_132(i) == o)and((dec_RAW_PDU_132(o) == i & '00'O))) {setverdict(pass);}
if ((enc_RAW_PDU_132(i) == o)and((dec_RAW_PDU_132(o) == '00'O & i))) {setverdict(pass);}
else {setverdict(fail,"enc_RAW_PDU_132(i)= ", enc_RAW_PDU_132(i), "; dec_RAW_PDU_132(o)= ", dec_RAW_PDU_132(o));}
}
......@@ -2942,9 +2942,9 @@ external function dec_RAW_PDU_133(in octetstring stream) return RAW_PDU_133 with
testcase TC_ALIGN_left_for_octetstring() runs on TempComp{
const RAW_PDU_133 i := '123456'O
const octetstring o := '00123456'O
const octetstring o := '12345600'O
if ((enc_RAW_PDU_133(i) == o)and((dec_RAW_PDU_133(o) == '00'O & i ))) {setverdict(pass);}
if ((enc_RAW_PDU_133(i) == o)and((dec_RAW_PDU_133(o) == i & '00'O))) {setverdict(pass);}
else {setverdict(fail,"enc_RAW_PDU_133(i)= ", enc_RAW_PDU_133(i), "; dec_RAW_PDU_133(o)= ", dec_RAW_PDU_133(o));}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment