Skip to content

Commit

Permalink
Refs #22284. Add regression test.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany committed Nov 26, 2024
1 parent ae92052 commit 649a4f5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/cdr/SimpleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7111,3 +7111,29 @@ TEST(FastCDRTests, StringWithNullChars)
},
BadParamException);
}

TEST(CDRTests, EmptyStringSerializationSize)
{
std::string str;
char buffer[256];
FastBuffer cdrbuffer(buffer, 256);
Cdr cdr_ser(cdrbuffer);
EXPECT_NO_THROW(
{
cdr_ser << str;
});
EXPECT_EQ(cdr.get_serialized_data_length(), 5u);
}

TEST(FastCDRTests, EmptyStringSerializationSize)
{
std::string str;
char buffer[256];
FastBuffer cdrbuffer(buffer, 256);
FastCdr cdr_ser(cdrbuffer);
EXPECT_NO_THROW(
{
cdr_ser << str;
});
EXPECT_EQ(cdr_ser.get_serialized_data_length(), 5u);
}

0 comments on commit 649a4f5

Please sign in to comment.