Skip to content

Commit 8828dc5

Browse files
committed
Refs #21537. Uncrustify.
Signed-off-by: Miguel Company <[email protected]>
1 parent 64b1a02 commit 8828dc5

File tree

1 file changed

+35
-31
lines changed

1 file changed

+35
-31
lines changed

test/unittest/rtps/builtin/BuiltinDataSerializationTests.cpp

+35-31
Original file line numberDiff line numberDiff line change
@@ -2325,60 +2325,64 @@ TEST(BuiltinDataSerializationTests, deserialization_of_big_parameters)
23252325
buffer[encapsulation_length + 3] = static_cast<octet>((big_parameter_plength >> 8) & 0xFF);
23262326

23272327
// Beware of semantically incorrect parameters
2328-
switch(pid)
2328+
switch (pid)
23292329
{
23302330
// The protocol version should be 2
23312331
case eprosima::fastdds::dds::PID_PROTOCOL_VERSION:
2332+
{
23322333
buffer[encapsulation_length + 4] = 0x02;
2333-
break;
2334+
}
2335+
break;
23342336

23352337
// The length of some string parameters should be lower than 256
23362338
case eprosima::fastdds::dds::PID_ENTITY_NAME:
23372339
case eprosima::fastdds::dds::PID_TYPE_NAME:
23382340
case eprosima::fastdds::dds::PID_TOPIC_NAME:
2341+
{
23392342
buffer[encapsulation_length + 2] = 0xFF;
23402343
buffer[encapsulation_length + 3] = 0x00;
2341-
break;
2344+
}
2345+
break;
23422346

23432347
// Data parameters should fill the whole parameter
23442348
case eprosima::fastdds::dds::PID_USER_DATA:
23452349
case eprosima::fastdds::dds::PID_TOPIC_DATA:
23462350
case eprosima::fastdds::dds::PID_GROUP_DATA:
2347-
{
2348-
constexpr uint16_t inner_data_length = big_parameter_plength - 4;
2349-
buffer[encapsulation_length + 4] = static_cast<octet>(inner_data_length & 0xFF);
2350-
buffer[encapsulation_length + 5] = static_cast<octet>((inner_data_length >> 8) & 0xFF);
2351-
}
2352-
break;
2351+
{
2352+
constexpr uint16_t inner_data_length = big_parameter_plength - 4;
2353+
buffer[encapsulation_length + 4] = static_cast<octet>(inner_data_length & 0xFF);
2354+
buffer[encapsulation_length + 5] = static_cast<octet>((inner_data_length >> 8) & 0xFF);
2355+
}
2356+
break;
23532357

23542358
// Custom content for partition
23552359
case eprosima::fastdds::dds::PID_PARTITION:
2356-
{
2357-
// Number of partitions (1)
2358-
buffer[encapsulation_length + 4] = 0x01;
2359-
buffer[encapsulation_length + 5] = 0x00;
2360-
buffer[encapsulation_length + 6] = 0x00;
2361-
buffer[encapsulation_length + 7] = 0x00;
2362-
// Partition name length (fills the rest of the parameter)
2363-
constexpr uint16_t partition_length = big_parameter_plength - 4 - 4;
2364-
buffer[encapsulation_length + 8] = static_cast<octet>(partition_length & 0xFF);
2365-
buffer[encapsulation_length + 9] = static_cast<octet>((partition_length >> 8) & 0xFF);
2366-
buffer[encapsulation_length + 10] = 0x00;
2367-
buffer[encapsulation_length + 11] = 0x00;
2368-
}
2369-
break;
2360+
{
2361+
// Number of partitions (1)
2362+
buffer[encapsulation_length + 4] = 0x01;
2363+
buffer[encapsulation_length + 5] = 0x00;
2364+
buffer[encapsulation_length + 6] = 0x00;
2365+
buffer[encapsulation_length + 7] = 0x00;
2366+
// Partition name length (fills the rest of the parameter)
2367+
constexpr uint16_t partition_length = big_parameter_plength - 4 - 4;
2368+
buffer[encapsulation_length + 8] = static_cast<octet>(partition_length & 0xFF);
2369+
buffer[encapsulation_length + 9] = static_cast<octet>((partition_length >> 8) & 0xFF);
2370+
buffer[encapsulation_length + 10] = 0x00;
2371+
buffer[encapsulation_length + 11] = 0x00;
2372+
}
2373+
break;
23702374

23712375
// Custom content for security tokens
23722376
case eprosima::fastdds::dds::PID_IDENTITY_TOKEN:
23732377
case eprosima::fastdds::dds::PID_PERMISSIONS_TOKEN:
2374-
{
2375-
// Content is a string + properties (0) + binary properties (0)
2376-
// Should fill the whole parameter
2377-
constexpr uint16_t token_string_length = big_parameter_plength - 4 - 4 - 4;
2378-
buffer[encapsulation_length + 4] = static_cast<octet>(token_string_length & 0xFF);
2379-
buffer[encapsulation_length + 5] = static_cast<octet>((token_string_length >> 8) & 0xFF);
2380-
}
2381-
break;
2378+
{
2379+
// Content is a string + properties (0) + binary properties (0)
2380+
// Should fill the whole parameter
2381+
constexpr uint16_t token_string_length = big_parameter_plength - 4 - 4 - 4;
2382+
buffer[encapsulation_length + 4] = static_cast<octet>(token_string_length & 0xFF);
2383+
buffer[encapsulation_length + 5] = static_cast<octet>((token_string_length >> 8) & 0xFF);
2384+
}
2385+
break;
23822386
}
23832387

23842388
// Deserialize a DATA(p)

0 commit comments

Comments
 (0)