-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove filter in avif_fuzztest_properties #2575
Conversation
2a79dcc
to
db37f71
Compare
Avoid failures due to "Ineffective use of Filter()".
db37f71
to
03daa30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
// Don't return known properties. | ||
return fuzztest::Filter( | ||
[](const TestProp& prop) { | ||
return !avifIsKnownPropertyType(prop.fourcc.data()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A random fourcc is unlikely to be a known property type. So this Filter should be okay.
} | ||
|
||
inline auto ArbitraryUUIDProp() { | ||
auto fourcc = fuzztest::Just(std::array<uint8_t, 4>{'u', 'u', 'i', 'd'}); | ||
auto uuid = fuzztest::Arbitrary<std::array<uint8_t, 16>>(); | ||
auto body = fuzztest::Arbitrary<std::vector<uint8_t>>(); | ||
// Don't use invalid UUIDs. | ||
return fuzztest::Filter( | ||
[](const TestProp& prop) { return avifIsValidUUID(prop.uuid.data()); }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a random 16-byte is likely to be an invalid UUID more than 90% of the time in the first 100 tries. It may make sense to replace line 87 (auto uuid = fuzztest::Arbitrary<std::array<uint8_t, 16>>();
) with custom code that generates a valid UUID.
Avoid failures due to "Ineffective use of Filter()".