Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ bool xcdr_v2_stream::finish_consecutive()

bool xcdr_v2_stream::write_em_header(const entity_properties_t &props)
{
uint32_t mheader = (props.must_understand || props.is_key ? must_understand : 0)
uint32_t mheader = (props.must_understand ? must_understand : 0)
+ (id_mask & props.m_id) + nextint;

return write(*this, mheader) && write(*this, uint32_t(0));
Expand Down
26 changes: 13 additions & 13 deletions src/ddscxx/tests/CDRStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ TEST_F(CDRStreamer, cdr_mutable)
0x40, 0x00, 0x00, 0x07 /*mutablestruct.l.emheader*/,
0x00, 0x00, 0x00, 0x04 /*mutablestruct.l.emheader.nextint*/,
0x00, 0x01, 0xE2, 0x40 /*mutablestruct.l*/,
0xC0, 0x00, 0x00, 0x05 /*mutablestruct.c.emheader*/,
0x40, 0x00, 0x00, 0x05 /*mutablestruct.c.emheader*/,
0x00, 0x00, 0x00, 0x01 /*mutablestruct.l.emheader.nextint*/,
'g' /*mutablestruct.c*/,
0x00, 0x00, 0x00 /*padding bytes (3)*/,
Expand All @@ -174,14 +174,14 @@ TEST_F(CDRStreamer, cdr_mutable)
0x40, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0B /*mutablestruct.str.emheader*/,
0x00, 0x00, 0x00, 0x07 /*mutablestruct.str.length*/, 'a', 'b', 'c', 'd', 'e', 'f', '\0' /*mutablestruct.str.c_str*/,
0x00 /*padding bytes (1)*/,
0x80, 0x00, 0x00, 0x05 /*mutablestruct.c.emheader*/,
0x00, 0x00, 0x00, 0x05 /*mutablestruct.c.emheader*/,
'g' /*mutablestruct.c*/,
0x00, 0x00, 0x00 /*padding bytes (3)*/,
0x20, 0x00, 0x00, 0x07 /*mutablestruct.l.emheader*/,
0x00, 0x01, 0xE2, 0x40 /*mutablestruct.l*/};
bytes MS_xcdr_v2_key {
0x00, 0x00, 0x00, 0x09 /*dheader*/,
0xC0, 0x00, 0x00, 0x05 /*mutablestruct.c.emheader*/,
0x40, 0x00, 0x00, 0x05 /*mutablestruct.c.emheader*/,
0x00, 0x00, 0x00, 0x01 /*mutablestruct.l.emheader.nextint*/,
'g' /*mutablestruct.c*/};

Expand Down Expand Up @@ -274,7 +274,7 @@ TEST_F(CDRStreamer, cdr_sequence)
};
bytes SSM_xcdr_v2_normal {
0x00, 0x00, 0x00, 0x2C/*sequence_struct.dheader*/,
0xC0, 0x00, 0x00, 0x00 /*sequence_struct.c.emheader.lc = 4 (nextint) + must_understand + id(0)*/,
0x40, 0x00, 0x00, 0x00 /*sequence_struct.c.emheader.lc = 4 (nextint) + id(0)*/,
0x00, 0x00, 0x00, 0x07 /*sequence_struct.c.emheader.nextint */,
0x00, 0x00, 0x00, 0x03/*sequence_struct.c.length*/, 'z', 'y', 'x'/*sequence_struct.c.data*/,
0x00 /*padding bytes (1)*/,
Expand All @@ -284,7 +284,7 @@ TEST_F(CDRStreamer, cdr_sequence)
};
bytes SSM_xcdr_v2_key {
0x00, 0x00, 0x00, 0x0F/*sequence_struct.dheader*/,
0xC0, 0x00, 0x00, 0x00 /*sequence_struct.c.emheader.lc = 4 (nextint) + must_understand + id(0)*/,
0x40, 0x00, 0x00, 0x00 /*sequence_struct.c.emheader.lc = 4 (nextint) + id(0)*/,
0x00, 0x00, 0x00, 0x07 /*sequence_struct.c.emheader.nextint */,
0x00, 0x00, 0x00, 0x03/*sequence_struct.c.length*/, 'z', 'y', 'x'/*sequence_struct.c.data*/,
};
Expand All @@ -293,15 +293,15 @@ TEST_F(CDRStreamer, cdr_sequence)
read it*/
bytes SSM_xcdr_v2_normal_lc_not_4 {
0x00, 0x00, 0x00, 0x24/*sequence_struct.dheader*/,
0xD0, 0x00, 0x00, 0x00 /*derived.c_d.emheader*/, /*lc = 5: length = sequence_struct.c.length*1 + must_understand + id(0)*/
0x50, 0x00, 0x00, 0x00 /*derived.c_d.emheader*/, /*lc = 5: length = sequence_struct.c.length*1 + id(0)*/
0x00, 0x00, 0x00, 0x03/*sequence_struct.c.length*/, 'z', 'y', 'x'/*sequence_struct.c.data*/,
0x00 /*padding bytes (1)*/,
0x60, 0x00, 0x00, 0x01 /*derived.l.emheader*/, /*lc = 6: length = sequence_struct.c.length*4 + id(1)*/
0x00, 0x00, 0x00, 0x04/*sequence_struct.l.length*/, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01/*sequence_struct.l.data*/
};
bytes SSM_xcdr_v2_key_lc_not_4 {
0x00, 0x00, 0x00, 0x0B/*sequence_struct.dheader*/,
0xD0, 0x00, 0x00, 0x00 /*derived.c_d.emheader*/, /*lc = 5: length = sequence_struct.c.length*1 + must_understand + id(0)*/
0x50, 0x00, 0x00, 0x00 /*derived.c_d.emheader*/, /*lc = 5: length = sequence_struct.c.length*1 + id(0)*/
0x00, 0x00, 0x00, 0x03/*sequence_struct.c.length*/, 'z', 'y', 'x'/*sequence_struct.c.data*/,
};

Expand Down Expand Up @@ -648,13 +648,13 @@ TEST_F(CDRStreamer, cdr_optional)
0x00, 0x00, 0x00, 0x01, /*optional_mutable_struct.b.emheader.nextint*/
'b', /*optional_mutable_struct.b*/
0x00, 0x00, 0x00, /*padding bytes*/
0xC0, 0x00, 0x00, 0x02, /*optional_mutable_struct.c.emheader*/
0x40, 0x00, 0x00, 0x02, /*optional_mutable_struct.c.emheader*/
0x00, 0x00, 0x00, 0x01, /*optional_mutable_struct.c.emheader.nextint*/
'c' /*optional_mutable_struct.c*/
};
bytes OMS_xcdr_v2_key {
0x00, 0x00, 0x00, 0x09, /*dheader*/
0xC0, 0x00, 0x00, 0x02, /*optional_mutable_struct.c.emheader*/
0x40, 0x00, 0x00, 0x02, /*optional_mutable_struct.c.emheader*/
0x00, 0x00, 0x00, 0x01, /*optional_mutable_struct.c.emheader.nextint*/
'c' /*optional_mutable_struct.c*/
};
Expand Down Expand Up @@ -715,13 +715,13 @@ TEST_F(CDRStreamer, cdr_must_understand)
0x00, 0x00, 0x00, 0x01, /*must_understand_struct.b.emheader.nextint*/
'b', /*must_understand_struct.b*/
0x00, 0x00, 0x00, /*padding bytes*/
0xC0, 0x00, 0x00, 0x03, /*must_understand_struct.c.emheader*/
0x40, 0x00, 0x00, 0x03, /*must_understand_struct.c.emheader*/
0x00, 0x00, 0x00, 0x01, /*must_understand_struct.c.emheader.nextint*/
'c', /*must_understand_struct.c*/
};
bytes v2_key {
0x00, 0x00, 0x00, 0x09, /*dheader*/
0xC0, 0x00, 0x00, 0x03, /*must_understand_struct.c.emheader*/
0x40, 0x00, 0x00, 0x03, /*must_understand_struct.c.emheader*/
0x00, 0x00, 0x00, 0x01, /*must_understand_struct.c.emheader.nextint*/
'c', /*must_understand_struct.c*/
};
Expand All @@ -744,7 +744,7 @@ TEST_F(CDRStreamer, cdr_must_understand)
0x00, 0x00, 0x00, 0x01, /*must_understand_struct.a.emheader.nextint*/
'a', /*must_understand_struct.a*/
0x00, 0x00, 0x00, /*padding bytes*/
0xC0, 0x00, 0x00, 0x03, /*must_understand_struct.c.emheader*/
0x40, 0x00, 0x00, 0x03, /*must_understand_struct.c.emheader*/
0x00, 0x00, 0x00, 0x01, /*must_understand_struct.c.emheader.nextint*/
'c', /*must_understand_struct.c*/
};
Expand Down Expand Up @@ -782,7 +782,7 @@ TEST_F(CDRStreamer, cdr_must_understand)
0x00, 0x00, 0x00, 0x01, /*must_understand_struct.b.emheader.nextint*/
'b', /*must_understand_struct.b*/
0x00, 0x00, 0x00, /*padding bytes*/
0xC0, 0x00, 0x00, 0x03, /*must_understand_struct.c.emheader*/
0x40, 0x00, 0x00, 0x03, /*must_understand_struct.c.emheader*/
0x00, 0x00, 0x00, 0x01, /*must_understand_struct.c.emheader.nextint*/
'c', /*must_understand_struct.c*/
};
Expand Down
Loading