Skip to content

Commit 37a462a

Browse files
restyled-commitstennessee-google
authored andcommitted
Restyled by clang-format
1 parent deca7f7 commit 37a462a

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

src/crypto/CHIPCryptoPAL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ CHIP_ERROR ReadDerLength(Reader & reader, size_t & length)
571571
for (uint8_t i = 0; i < length_bytes; i++)
572572
{
573573
uint8_t cur_length_byte = 0;
574-
err = reader.Read8(&cur_length_byte).StatusCode();
574+
err = reader.Read8(&cur_length_byte).StatusCode();
575575
if (err != CHIP_NO_ERROR)
576576
break;
577577

src/crypto/tests/CHIPCryptoPALTest.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -612,28 +612,28 @@ static void TestRawIntegerToDerInvalidCases(nlTestSuite * inSuite, void * inCont
612612

613613
static void TestReadDerLengthValidCases(nlTestSuite * inSuite, void * inContext)
614614
{
615-
const uint8_t short_zero_length[] = {0x00};
615+
const uint8_t short_zero_length[] = { 0x00 };
616616
ByteSpan short_zero_length_buf(short_zero_length);
617617

618-
const uint8_t short_length[] = {0x15};
618+
const uint8_t short_length[] = { 0x15 };
619619
ByteSpan short_length_buf(short_length);
620620

621-
const uint8_t single_byte_length[] = {0x81, 0x80};
621+
const uint8_t single_byte_length[] = { 0x81, 0x80 };
622622
ByteSpan single_byte_length_buf(single_byte_length);
623623

624-
const uint8_t single_byte_length_large[] = {0x81, 0xFF};
624+
const uint8_t single_byte_length_large[] = { 0x81, 0xFF };
625625
ByteSpan single_byte_length_large_buf(single_byte_length_large);
626626

627-
const uint8_t two_byte_length[] = {0x82, 0xFF, 0x01};
627+
const uint8_t two_byte_length[] = { 0x82, 0xFF, 0x01 };
628628
ByteSpan two_byte_length_buf(two_byte_length);
629629

630-
const uint8_t three_byte_length[] = {0x83, 0xFF, 0x00, 0xAA};
630+
const uint8_t three_byte_length[] = { 0x83, 0xFF, 0x00, 0xAA };
631631
ByteSpan three_byte_length_buf(three_byte_length);
632632

633-
const uint8_t four_byte_length[] = {0x84, 0x01, 0x02, 0x03, 0x04};
633+
const uint8_t four_byte_length[] = { 0x84, 0x01, 0x02, 0x03, 0x04 };
634634
ByteSpan four_byte_length_buf(four_byte_length);
635635

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 };
637637
ByteSpan four_byte_length_large_buf(four_byte_length_large);
638638

639639
uint8_t max_byte_length_large[1 + sizeof(size_t)];
@@ -665,7 +665,7 @@ static void TestReadDerLengthValidCases(nlTestSuite * inSuite, void * inContext)
665665
for (const SuccessCase & v : cases)
666666
{
667667
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 };
669669
CHIP_ERROR status = ReadDerLength(input_reader, output_length);
670670
if ((status != CHIP_NO_ERROR) || (v.expected_length != output_length))
671671
{
@@ -684,22 +684,22 @@ static void TestReadDerLengthInvalidCases(nlTestSuite * inSuite, void * inContex
684684
ByteSpan bad_buffer_nullptr(nullptr, sizeof(placeholder));
685685
ByteSpan bad_buffer_empty(placeholder, 0);
686686

687-
const uint8_t zero_multi_byte_length[] = {0x80};
687+
const uint8_t zero_multi_byte_length[] = { 0x80 };
688688
ByteSpan zero_multi_byte_length_buf(zero_multi_byte_length);
689689

690-
const uint8_t single_byte_length_zero[] = {0x81, 0x00};
690+
const uint8_t single_byte_length_zero[] = { 0x81, 0x00 };
691691
ByteSpan single_byte_length_zero_buf(single_byte_length_zero);
692692

693-
const uint8_t single_byte_length_too_small[] = {0x81, 0x7F};
693+
const uint8_t single_byte_length_too_small[] = { 0x81, 0x7F };
694694
ByteSpan single_byte_length_too_small_buf(single_byte_length_too_small);
695695

696-
const uint8_t multiple_byte_length_zero_padded[] = {0x82, 0x00, 0xFF};
696+
const uint8_t multiple_byte_length_zero_padded[] = { 0x82, 0x00, 0xFF };
697697
ByteSpan multiple_byte_length_zero_padded_buf(multiple_byte_length_zero_padded);
698698

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 };
700700
ByteSpan multiple_byte_length_insufficient_bytes_buf(multiple_byte_length_insufficient_bytes);
701701

702-
const uint8_t multiple_byte_length_insufficient_bytes2[] = {0x83};
702+
const uint8_t multiple_byte_length_insufficient_bytes2[] = { 0x83 };
703703
ByteSpan multiple_byte_length_insufficient_bytes2_buf(multiple_byte_length_insufficient_bytes2);
704704

705705
uint8_t max_byte_length_large_insufficient_bytes[1 + sizeof(size_t) - 1];
@@ -718,8 +718,8 @@ static void TestReadDerLengthInvalidCases(nlTestSuite * inSuite, void * inContex
718718
const ErrorCase error_cases[] = {
719719
{ .input_buf = bad_buffer_nullptr, .expected_status = CHIP_ERROR_BUFFER_TOO_SMALL },
720720
{ .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 },
723723
{ .input_buf = single_byte_length_too_small_buf, .expected_status = CHIP_ERROR_INVALID_ARGUMENT },
724724
{ .input_buf = multiple_byte_length_zero_padded_buf, .expected_status = CHIP_ERROR_INVALID_ARGUMENT },
725725
{ .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
731731
for (const ErrorCase & v : error_cases)
732732
{
733733
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 };
735735
CHIP_ERROR status = ReadDerLength(input_reader, output_length);
736736
if (status != v.expected_status)
737737
{

src/lib/support/UnitTestExtendedAssertions.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@
6262
* @param[in] inExpr2 Right hand-side to check
6363
*
6464
*/
65-
#define NL_TEST_ASSERT_EQUALS(inSuite, inExpr1, inExpr2) \
66-
do \
67-
{ \
68-
(inSuite)->performedAssertions += 1; \
69-
\
70-
if (!((inExpr1) == (inExpr2))) \
71-
{ \
72-
printf("%s:%u: assertion failed: %s == %s\n", __FILE__, __LINE__, #inExpr1, #inExpr2); \
73-
(inSuite)->failedAssertions += 1; \
74-
(inSuite)->flagError = true; \
75-
} \
65+
#define NL_TEST_ASSERT_EQUALS(inSuite, inExpr1, inExpr2) \
66+
do \
67+
{ \
68+
(inSuite)->performedAssertions += 1; \
69+
\
70+
if (!((inExpr1) == (inExpr2))) \
71+
{ \
72+
printf("%s:%u: assertion failed: %s == %s\n", __FILE__, __LINE__, #inExpr1, #inExpr2); \
73+
(inSuite)->failedAssertions += 1; \
74+
(inSuite)->flagError = true; \
75+
} \
7676
} while (0)

0 commit comments

Comments
 (0)