Skip to content

Commit

Permalink
Refs #21362. Add 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 4, 2024
1 parent b7110b4 commit 2fcd408
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/cdr/SimpleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7081,3 +7081,17 @@ TEST(FastCDRTests, ZeroSequenceAtTheEnd)
cdr_des_bool >> value >> bool_zero_sequence;
});
}

TEST(FastCDRTests, StringWithNullChars)
{
std::string str = "Hello\0World";
char buffer[256];
FastBuffer cdrbuffer(buffer, 256);
FastCdr cdr_ser(cdrbuffer);

EXPECT_THROW(
{
cdr_ser << str;
},
BadParamException);
}

0 comments on commit 2fcd408

Please sign in to comment.