Skip to content

Commit 19aefd5

Browse files
restyled-commitsAlami-Amine
authored andcommitted
Restyled by clang-format
1 parent 507e5ee commit 19aefd5

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

src/lib/core/tests/FuzzTlvReaderPW.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010

1111
using chip::TLV::TLVReader;
1212

13-
1413
using namespace fuzztest;
1514

16-
1715
static CHIP_ERROR FuzzIterator(const TLVReader & aReader, size_t aDepth, void * aContext)
1816
{
1917
aReader.GetLength();
@@ -27,7 +25,6 @@ void FuzzTlvRead(const std::vector<std::uint8_t> & bytes)
2725
TLVReader reader;
2826
reader.Init(bytes.data(), bytes.size());
2927
chip::TLV::Utilities::Iterate(reader, FuzzIterator, nullptr);
30-
3128
}
3229

3330
FUZZ_TEST(ChipCert, FuzzTlvRead).WithDomains(Arbitrary<std::vector<std::uint8_t>>());

src/lib/dnssd/minimal_mdns/tests/FuzzPacketParsingPW.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <cstddef>
22
#include <cstdint>
33

4-
54
#include <pw_fuzzer/fuzztest.h>
65
#include <pw_unit_test/framework.h>
76

@@ -10,10 +9,8 @@
109

1110
using namespace fuzztest;
1211

13-
1412
namespace {
1513

16-
1714
using namespace chip;
1815
using namespace mdns::Minimal;
1916

@@ -63,11 +60,10 @@ class FuzzDelegate : public ParserDelegate
6360

6461
void PacketParserFuzz(const std::vector<std::uint8_t> & bytes)
6562
{
66-
BytesRange packet(bytes.data(), bytes.data() + bytes.size());
67-
FuzzDelegate delegate(packet);
68-
69-
mdns::Minimal::ParsePacket(packet, &delegate);
63+
BytesRange packet(bytes.data(), bytes.data() + bytes.size());
64+
FuzzDelegate delegate(packet);
7065

66+
mdns::Minimal::ParsePacket(packet, &delegate);
7167
}
7268

7369
FUZZ_TEST(MinimalmDNS, PacketParserFuzz).WithDomains(Arbitrary<std::vector<std::uint8_t>>());

src/lib/format/tests/FuzzPayloadDecoderPW.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ void RunDecodePW(const std::vector<std::uint8_t> & bytes, chip::Protocols::Id mP
4343
// Fuzzing with different Protocols
4444
params.SetProtocol(mProtocol);
4545

46-
4746
// Fuzzing with different MessageTypes
4847
params.SetMessageType(mMessageType);
4948
chip::Decoders::PayloadDecoder<64, 128> decoder(params);

src/setup_payload/tests/FuzzBase38PW.cpp

+3-13
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22
#include <cstdint>
33
#include <iostream>
44

5-
65
#include <pw_fuzzer/fuzztest.h>
76
#include <pw_unit_test/framework.h>
87

9-
108
#include <setup_payload/Base38Decode.h>
119
#include <setup_payload/Base38Encode.h>
1210

1311
using namespace fuzztest;
1412
using namespace chip;
1513

16-
1714
// The property Function
1815
void Base38DecodeFuzz(const std::vector<uint8_t> & bytes)
1916
{
@@ -25,11 +22,6 @@ void Base38DecodeFuzz(const std::vector<uint8_t> & bytes)
2522
chip::base38Decode(base38EncodedString, decodedData);
2623
}
2724

28-
29-
30-
31-
32-
3325
/* The property function for a base38 roundtrip Fuzzer.
3426
* It starts by encoding the fuzzing value passed
3527
* into Base38. The encoded value will then be decoded.
@@ -42,7 +34,6 @@ void Base38RoundTripFuzz(const std::vector<uint8_t> & bytes)
4234
size_t outputSizeNeeded = base38EncodedLength(bytes.size());
4335
const size_t kMaxOutputSize = 512;
4436

45-
4637
ASSERT_LT(outputSizeNeeded, kMaxOutputSize);
4738

4839
ByteSpan span(bytes.data(), bytes.size());
@@ -57,16 +48,15 @@ void Base38RoundTripFuzz(const std::vector<uint8_t> & bytes)
5748
std::vector<uint8_t> decodedData;
5849
CHIP_ERROR decodingError = base38Decode(base38EncodedString, decodedData);
5950

60-
6151
ASSERT_EQ(decodingError, CHIP_NO_ERROR);
6252

63-
//Make sure that decoded data is equal to the original fuzzed input; the bytes vector
53+
// Make sure that decoded data is equal to the original fuzzed input; the bytes vector
6454
ASSERT_EQ(decodedData, bytes);
65-
6655
}
6756

6857
// The invocation of the FuzzTest
6958
FUZZ_TEST(Base38Decoder, Base38DecodeFuzz).WithDomains(Arbitrary<std::vector<uint8_t>>());
7059

71-
//Max size of the vector is defined as 306 since that will give an outputSizeNeeded of 511 which is less than the required kMaxOutputSize
60+
// Max size of the vector is defined as 306 since that will give an outputSizeNeeded of 511 which is less than the required
61+
// kMaxOutputSize
7262
FUZZ_TEST(Base38Decoder, Base38RoundTripFuzz).WithDomains(Arbitrary<std::vector<uint8_t>>().WithMaxSize(306));

0 commit comments

Comments
 (0)