uorb: enure message definitions don't exceed buffer lengths & increase test buffer

There were already checks at runtime, but this ensures the format is not
too long at built-time.
This commit is contained in:
Beat Küng
2023-12-04 15:51:28 +01:00
committed by Silvan Fuhrer
parent df46ad7774
commit c5101c70b3
4 changed files with 12 additions and 1 deletions
@@ -53,7 +53,10 @@ public:
TEST_F(uORBMessageFieldsTest, decompressed_formats_match)
{
char buffer[1500];
char buffer[1600];
static_assert(uORB::orb_untokenized_fields_max_length < sizeof(buffer) - HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(_),
"msg definition too long / buffer too short");
uORB::MessageFormatReader format_reader(buffer, sizeof(buffer));
px4::Bitset<ORB_TOPICS_COUNT> formats_found;