Skip to content

Commit 6262f64

Browse files
restyled-commitsmbknust
authored andcommitted
Restyled by clang-format
1 parent 65f22f8 commit 6262f64

File tree

5 files changed

+27
-41
lines changed

5 files changed

+27
-41
lines changed

src/lib/core/tests/TestCATValues.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
2019
#include <gtest/gtest.h>
2120

2221
#include <lib/core/CASEAuthTag.h>

src/lib/core/tests/TestOTAImageHeader.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include <lib/core/OTAImageHeader.h>
2020

21-
2221
#include <gtest/gtest.h>
2322

2423
using namespace chip;

src/lib/core/tests/TestOptional.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <lib/core/Optional.h>
3232
#include <lib/support/Span.h>
3333

34-
3534
#include <gtest/gtest.h>
3635

3736
using namespace chip;

src/lib/core/tests/TestReferenceCounted.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
#include <lib/core/ReferenceCounted.h>
3131

32-
3332
#include <gtest/gtest.h>
3433

3534
using namespace chip;

src/lib/core/tests/TestTLV.cpp

+27-37
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
*
2424
*/
2525

26-
#include <nlbyteorder.h>
2726
#include <gtest/gtest.h>
27+
#include <nlbyteorder.h>
2828

2929
#include <lib/core/CHIPCore.h>
3030
#include <lib/core/TLV.h>
@@ -143,26 +143,25 @@ void TestEndAndExitContainer(T & t, TLVType outerContainerType)
143143
EXPECT_EQ(t.GetContainerType(), outerContainerType);
144144
}
145145

146-
#define TEST_GET(s, type, tag, expectedVal, expectedErr) \
146+
#define TEST_GET(s, type, tag, expectedVal, expectedErr) \
147147
do \
148148
{ \
149-
EXPECT_EQ(s.GetType(), type); \
150-
EXPECT_EQ(s.GetTag(), tag); \
151-
EXPECT_EQ(s.GetLength(), 0u); \
149+
EXPECT_EQ(s.GetType(), type); \
150+
EXPECT_EQ(s.GetTag(), tag); \
151+
EXPECT_EQ(s.GetLength(), 0u); \
152152
\
153153
decltype(expectedVal) __val; \
154154
CHIP_ERROR __err = s.Get(__val); \
155-
EXPECT_EQ(__err, expectedErr); \
155+
EXPECT_EQ(__err, expectedErr); \
156156
if (__err == CHIP_NO_ERROR) \
157157
{ \
158-
EXPECT_EQ(__val, expectedVal); \
158+
EXPECT_EQ(__val, expectedVal); \
159159
} \
160160
} while (false)
161161

162162
#define TEST_GET_NOERROR(s, type, tag, expectedVal) TEST_GET(s, type, tag, expectedVal, CHIP_NO_ERROR)
163163

164-
void ForEachElement(TLVReader & reader, void * context,
165-
void (*cb)(TLVReader & reader, void * context))
164+
void ForEachElement(TLVReader & reader, void * context, void (*cb)(TLVReader & reader, void * context))
166165
{
167166
CHIP_ERROR err;
168167

@@ -276,8 +275,7 @@ void TestDupBytes(TLVReader & reader, Tag tag, const uint8_t * expectedVal, uint
276275
chip::Platform::MemoryFree(val);
277276
}
278277

279-
void TestBufferContents(const System::PacketBufferHandle & buffer, const uint8_t * expectedVal,
280-
uint32_t expectedLen)
278+
void TestBufferContents(const System::PacketBufferHandle & buffer, const uint8_t * expectedVal, uint32_t expectedLen)
281279
{
282280
System::PacketBufferHandle buf = buffer.Retain();
283281
while (!buf.IsNull())
@@ -727,21 +725,17 @@ void ReadEncoding1(TLVReader & reader)
727725
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int32_t>(42));
728726
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int64_t>(42));
729727
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint8_t>(42), CHIP_ERROR_WRONG_TLV_TYPE);
730-
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint16_t>(42),
731-
CHIP_ERROR_WRONG_TLV_TYPE);
732-
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint32_t>(42),
733-
CHIP_ERROR_WRONG_TLV_TYPE);
734-
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint64_t>(42),
735-
CHIP_ERROR_WRONG_TLV_TYPE);
728+
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint16_t>(42), CHIP_ERROR_WRONG_TLV_TYPE);
729+
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint32_t>(42), CHIP_ERROR_WRONG_TLV_TYPE);
730+
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint64_t>(42), CHIP_ERROR_WRONG_TLV_TYPE);
736731

737732
TestNext<TLVReader>(reader3);
738733

739734
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int8_t>(-17));
740735
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int16_t>(-17));
741736
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int32_t>(-17));
742737
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int64_t>(-17));
743-
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint64_t>(-17),
744-
CHIP_ERROR_WRONG_TLV_TYPE);
738+
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint64_t>(-17), CHIP_ERROR_WRONG_TLV_TYPE);
745739

746740
TestNext<TLVReader>(reader3);
747741

@@ -811,8 +805,7 @@ void ReadEncoding1(TLVReader & reader)
811805
TestNext<TLVReader>(reader2);
812806

813807
TEST_GET_NOERROR(reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), 17.9f);
814-
TEST_GET_NOERROR(reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535),
815-
static_cast<double>(17.9f));
808+
TEST_GET_NOERROR(reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), static_cast<double>(17.9f));
816809

817810
TestNext<TLVReader>(reader2);
818811

@@ -1131,8 +1124,7 @@ void AppendEncoding2(uint8_t * buf, uint32_t dataLen, uint32_t maxLen, uint32_t
11311124
* <TestProfile_1, 1, kTLVType_Structure, <TestProfile_1, 2, true> <TestProfile_2, 2, false> >,
11321125
* <TestProfile_2, 1, kTLVType_Structure, <TestProfile_2, 2, false> <TestProfile_1, 2, true> >
11331126
*/
1134-
void FindAppendEncoding2(uint8_t * buf, uint32_t dataLen, uint32_t maxLen, uint32_t & updatedLen,
1135-
bool findContainer)
1127+
void FindAppendEncoding2(uint8_t * buf, uint32_t dataLen, uint32_t maxLen, uint32_t & updatedLen, bool findContainer)
11361128
{
11371129
CHIP_ERROR err;
11381130

@@ -2443,7 +2435,8 @@ TEST_F(TestTLV, CheckCircularTLVBufferEvictStraddlingEvent)
24432435

24442436
WriteEncoding3(writer);
24452437

2446-
EXPECT_EQ(writer.GetLengthWritten(), (8u * 11 + 7)); // 8 writes of Encoding3 (11 bytes each) and 7 bytes for the initial boolean.
2438+
EXPECT_EQ(writer.GetLengthWritten(),
2439+
(8u * 11 + 7)); // 8 writes of Encoding3 (11 bytes each) and 7 bytes for the initial boolean.
24472440
EXPECT_EQ(buffer.DataLength(), 22u);
24482441
EXPECT_EQ((buffer.DataLength() + context->mEvictedBytes), writer.GetLengthWritten());
24492442
EXPECT_EQ(context->mEvictionCount, 7);
@@ -3471,10 +3464,8 @@ void TestTLVReaderDup()
34713464
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int16_t>(42));
34723465
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int32_t>(42));
34733466
TEST_GET_NOERROR(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<int64_t>(42));
3474-
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint32_t>(42),
3475-
CHIP_ERROR_WRONG_TLV_TYPE);
3476-
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint64_t>(42),
3477-
CHIP_ERROR_WRONG_TLV_TYPE);
3467+
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint32_t>(42), CHIP_ERROR_WRONG_TLV_TYPE);
3468+
TEST_GET(reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast<uint64_t>(42), CHIP_ERROR_WRONG_TLV_TYPE);
34783469

34793470
TestNext<TLVReader>(reader3);
34803471

@@ -3551,8 +3542,7 @@ void TestTLVReaderDup()
35513542
TestNext<TLVReader>(reader2);
35523543

35533544
TEST_GET_NOERROR(reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), 17.9f);
3554-
TEST_GET_NOERROR(reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535),
3555-
static_cast<double>(17.9f));
3545+
TEST_GET_NOERROR(reader2, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_2, 65535), static_cast<double>(17.9f));
35563546

35573547
TestNext<TLVReader>(reader2);
35583548

@@ -3739,13 +3729,11 @@ void TestTLVReaderInPractice()
37393729

37403730
TestNext<TLVReader>(reader);
37413731

3742-
TEST_GET_NOERROR(reader, kTLVType_SignedInteger, ProfileTag(TestProfile_1, 4000000000ULL),
3743-
static_cast<int64_t>(12345));
3732+
TEST_GET_NOERROR(reader, kTLVType_SignedInteger, ProfileTag(TestProfile_1, 4000000000ULL), static_cast<int64_t>(12345));
37443733

37453734
TestNext<TLVReader>(reader);
37463735

3747-
TEST_GET_NOERROR(reader, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_1, 4000000000ULL),
3748-
static_cast<float>(1.0));
3736+
TEST_GET_NOERROR(reader, kTLVType_FloatingPointNumber, ProfileTag(TestProfile_1, 4000000000ULL), static_cast<float>(1.0));
37493737
}
37503738

37513739
void TestTLVReader_NextOverContainer_ProcessElement(TLVReader & reader, void * context)
@@ -4879,7 +4867,8 @@ TEST_F(TestTLV, TestUninitializedWriter)
48794867
TLVWriter writer;
48804868
TLVType outerContainerType;
48814869

4882-
EXPECT_EQ(writer.StartContainer(ContextTag(1), TLVType::kTLVType_Structure, outerContainerType), CHIP_ERROR_INCORRECT_STATE);
4870+
EXPECT_EQ(writer.StartContainer(ContextTag(1), TLVType::kTLVType_Structure, outerContainerType),
4871+
CHIP_ERROR_INCORRECT_STATE);
48834872
}
48844873

48854874
{
@@ -4911,8 +4900,9 @@ TEST_F(TestTLV, TestUninitializedWriter)
49114900
{
49124901
uint8_t buf[]{ 0, 0, 0 };
49134902
TLVWriter writer;
4914-
EXPECT_EQ(writer.PutPreEncodedContainer(ContextTag(1), TLVType::kTLVType_Structure, buf,
4915-
static_cast<uint32_t>(sizeof(buf))), CHIP_ERROR_INCORRECT_STATE);
4903+
EXPECT_EQ(
4904+
writer.PutPreEncodedContainer(ContextTag(1), TLVType::kTLVType_Structure, buf, static_cast<uint32_t>(sizeof(buf))),
4905+
CHIP_ERROR_INCORRECT_STATE);
49164906
}
49174907

49184908
{

0 commit comments

Comments
 (0)