@@ -2325,60 +2325,64 @@ TEST(BuiltinDataSerializationTests, deserialization_of_big_parameters)
2325
2325
buffer[encapsulation_length + 3 ] = static_cast <octet>((big_parameter_plength >> 8 ) & 0xFF );
2326
2326
2327
2327
// Beware of semantically incorrect parameters
2328
- switch (pid)
2328
+ switch (pid)
2329
2329
{
2330
2330
// The protocol version should be 2
2331
2331
case eprosima::fastdds::dds::PID_PROTOCOL_VERSION:
2332
+ {
2332
2333
buffer[encapsulation_length + 4 ] = 0x02 ;
2333
- break ;
2334
+ }
2335
+ break ;
2334
2336
2335
2337
// The length of some string parameters should be lower than 256
2336
2338
case eprosima::fastdds::dds::PID_ENTITY_NAME:
2337
2339
case eprosima::fastdds::dds::PID_TYPE_NAME:
2338
2340
case eprosima::fastdds::dds::PID_TOPIC_NAME:
2341
+ {
2339
2342
buffer[encapsulation_length + 2 ] = 0xFF ;
2340
2343
buffer[encapsulation_length + 3 ] = 0x00 ;
2341
- break ;
2344
+ }
2345
+ break ;
2342
2346
2343
2347
// Data parameters should fill the whole parameter
2344
2348
case eprosima::fastdds::dds::PID_USER_DATA:
2345
2349
case eprosima::fastdds::dds::PID_TOPIC_DATA:
2346
2350
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 ;
2353
2357
2354
2358
// Custom content for partition
2355
2359
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 ;
2370
2374
2371
2375
// Custom content for security tokens
2372
2376
case eprosima::fastdds::dds::PID_IDENTITY_TOKEN:
2373
2377
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 ;
2382
2386
}
2383
2387
2384
2388
// Deserialize a DATA(p)
0 commit comments