@@ -612,28 +612,28 @@ static void TestRawIntegerToDerInvalidCases(nlTestSuite * inSuite, void * inCont
612
612
613
613
static void TestReadDerLengthValidCases (nlTestSuite * inSuite, void * inContext)
614
614
{
615
- const uint8_t short_zero_length[] = {0x00 };
615
+ const uint8_t short_zero_length[] = { 0x00 };
616
616
ByteSpan short_zero_length_buf (short_zero_length);
617
617
618
- const uint8_t short_length[] = {0x15 };
618
+ const uint8_t short_length[] = { 0x15 };
619
619
ByteSpan short_length_buf (short_length);
620
620
621
- const uint8_t single_byte_length[] = {0x81 , 0x80 };
621
+ const uint8_t single_byte_length[] = { 0x81 , 0x80 };
622
622
ByteSpan single_byte_length_buf (single_byte_length);
623
623
624
- const uint8_t single_byte_length_large[] = {0x81 , 0xFF };
624
+ const uint8_t single_byte_length_large[] = { 0x81 , 0xFF };
625
625
ByteSpan single_byte_length_large_buf (single_byte_length_large);
626
626
627
- const uint8_t two_byte_length[] = {0x82 , 0xFF , 0x01 };
627
+ const uint8_t two_byte_length[] = { 0x82 , 0xFF , 0x01 };
628
628
ByteSpan two_byte_length_buf (two_byte_length);
629
629
630
- const uint8_t three_byte_length[] = {0x83 , 0xFF , 0x00 , 0xAA };
630
+ const uint8_t three_byte_length[] = { 0x83 , 0xFF , 0x00 , 0xAA };
631
631
ByteSpan three_byte_length_buf (three_byte_length);
632
632
633
- const uint8_t four_byte_length[] = {0x84 , 0x01 , 0x02 , 0x03 , 0x04 };
633
+ const uint8_t four_byte_length[] = { 0x84 , 0x01 , 0x02 , 0x03 , 0x04 };
634
634
ByteSpan four_byte_length_buf (four_byte_length);
635
635
636
- const uint8_t four_byte_length_large[] = {0x84 , 0xFF , 0xFF , 0xFF , 0xFF };
636
+ const uint8_t four_byte_length_large[] = { 0x84 , 0xFF , 0xFF , 0xFF , 0xFF };
637
637
ByteSpan four_byte_length_large_buf (four_byte_length_large);
638
638
639
639
uint8_t max_byte_length_large[1 + sizeof (size_t )];
@@ -665,7 +665,7 @@ static void TestReadDerLengthValidCases(nlTestSuite * inSuite, void * inContext)
665
665
for (const SuccessCase & v : cases)
666
666
{
667
667
size_t output_length = SIZE_MAX - 1 ;
668
- chip::Encoding::LittleEndian::Reader input_reader{v.input_buf };
668
+ chip::Encoding::LittleEndian::Reader input_reader{ v.input_buf };
669
669
CHIP_ERROR status = ReadDerLength (input_reader, output_length);
670
670
if ((status != CHIP_NO_ERROR) || (v.expected_length != output_length))
671
671
{
@@ -684,22 +684,22 @@ static void TestReadDerLengthInvalidCases(nlTestSuite * inSuite, void * inContex
684
684
ByteSpan bad_buffer_nullptr (nullptr , sizeof (placeholder));
685
685
ByteSpan bad_buffer_empty (placeholder, 0 );
686
686
687
- const uint8_t zero_multi_byte_length[] = {0x80 };
687
+ const uint8_t zero_multi_byte_length[] = { 0x80 };
688
688
ByteSpan zero_multi_byte_length_buf (zero_multi_byte_length);
689
689
690
- const uint8_t single_byte_length_zero[] = {0x81 , 0x00 };
690
+ const uint8_t single_byte_length_zero[] = { 0x81 , 0x00 };
691
691
ByteSpan single_byte_length_zero_buf (single_byte_length_zero);
692
692
693
- const uint8_t single_byte_length_too_small[] = {0x81 , 0x7F };
693
+ const uint8_t single_byte_length_too_small[] = { 0x81 , 0x7F };
694
694
ByteSpan single_byte_length_too_small_buf (single_byte_length_too_small);
695
695
696
- const uint8_t multiple_byte_length_zero_padded[] = {0x82 , 0x00 , 0xFF };
696
+ const uint8_t multiple_byte_length_zero_padded[] = { 0x82 , 0x00 , 0xFF };
697
697
ByteSpan multiple_byte_length_zero_padded_buf (multiple_byte_length_zero_padded);
698
698
699
- const uint8_t multiple_byte_length_insufficient_bytes[] = {0x84 , 0xFF , 0xAA , 0x01 };
699
+ const uint8_t multiple_byte_length_insufficient_bytes[] = { 0x84 , 0xFF , 0xAA , 0x01 };
700
700
ByteSpan multiple_byte_length_insufficient_bytes_buf (multiple_byte_length_insufficient_bytes);
701
701
702
- const uint8_t multiple_byte_length_insufficient_bytes2[] = {0x83 };
702
+ const uint8_t multiple_byte_length_insufficient_bytes2[] = { 0x83 };
703
703
ByteSpan multiple_byte_length_insufficient_bytes2_buf (multiple_byte_length_insufficient_bytes2);
704
704
705
705
uint8_t max_byte_length_large_insufficient_bytes[1 + sizeof (size_t ) - 1 ];
@@ -718,8 +718,8 @@ static void TestReadDerLengthInvalidCases(nlTestSuite * inSuite, void * inContex
718
718
const ErrorCase error_cases[] = {
719
719
{ .input_buf = bad_buffer_nullptr, .expected_status = CHIP_ERROR_BUFFER_TOO_SMALL },
720
720
{ .input_buf = bad_buffer_empty, .expected_status = CHIP_ERROR_BUFFER_TOO_SMALL },
721
- { .input_buf = zero_multi_byte_length_buf,.expected_status = CHIP_ERROR_INVALID_ARGUMENT },
722
- { .input_buf = single_byte_length_zero_buf,.expected_status = CHIP_ERROR_INVALID_ARGUMENT },
721
+ { .input_buf = zero_multi_byte_length_buf, .expected_status = CHIP_ERROR_INVALID_ARGUMENT },
722
+ { .input_buf = single_byte_length_zero_buf, .expected_status = CHIP_ERROR_INVALID_ARGUMENT },
723
723
{ .input_buf = single_byte_length_too_small_buf, .expected_status = CHIP_ERROR_INVALID_ARGUMENT },
724
724
{ .input_buf = multiple_byte_length_zero_padded_buf, .expected_status = CHIP_ERROR_INVALID_ARGUMENT },
725
725
{ .input_buf = multiple_byte_length_insufficient_bytes_buf, .expected_status = CHIP_ERROR_BUFFER_TOO_SMALL },
@@ -731,7 +731,7 @@ static void TestReadDerLengthInvalidCases(nlTestSuite * inSuite, void * inContex
731
731
for (const ErrorCase & v : error_cases)
732
732
{
733
733
size_t output_length = SIZE_MAX;
734
- chip::Encoding::LittleEndian::Reader input_reader{v.input_buf };
734
+ chip::Encoding::LittleEndian::Reader input_reader{ v.input_buf };
735
735
CHIP_ERROR status = ReadDerLength (input_reader, output_length);
736
736
if (status != v.expected_status )
737
737
{
0 commit comments