Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a441d89

Browse files
committedSep 27, 2024·
Adding More protocol types to Fuzzed Payload Decoder
1 parent 1b70771 commit a441d89

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/lib/format/tests/FuzzPayloadDecoderPW.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,17 @@ void RunDecodeFuzz(const std::vector<std::uint8_t> & bytes, chip::Protocols::Id
5959
}
6060
}
6161

62-
// This function allows us to fuzz using one of four protocols; by using FuzzTests's `ElementOf` API, we define an
62+
// This function allows us to fuzz using all existing protocols; by using FuzzTests's `ElementOf` API, we define an
6363
// input domain by explicitly enumerating the set of values in it More Info:
6464
// https://github.com/google/fuzztest/blob/main/doc/domains-reference.md#elementof-domains-element-of
6565
auto AnyProtocolID()
6666
{
67+
// Adding an Invalid Protocol
68+
static constexpr chip::Protocols::Id InvalidProtocolID(chip::VendorId::Common, 2121);
69+
6770
return ElementOf({ chip::Protocols::SecureChannel::Id, chip::Protocols::InteractionModel::Id, chip::Protocols::BDX::Id,
68-
chip::Protocols::UserDirectedCommissioning::Id });
71+
chip::Protocols::UserDirectedCommissioning::Id, chip::Protocols::Echo::Id, chip::Protocols::NotSpecified,
72+
InvalidProtocolID });
6973
}
7074

7175
FUZZ_TEST(PayloadDecoder, RunDecodeFuzz).WithDomains(Arbitrary<std::vector<std::uint8_t>>(), AnyProtocolID(), Arbitrary<uint8_t>());

0 commit comments

Comments
 (0)
Please sign in to comment.