From db37f71cc5b1692ac09adb67829334efeb9ed0b1 Mon Sep 17 00:00:00 2001 From: Yannis Guyon Date: Fri, 17 Jan 2025 13:48:26 +0100 Subject: [PATCH] Remove filter in avif_fuzztest_properties Avoid failures due to "Ineffective use of Filter()". --- tests/gtest/avif_fuzztest_properties.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/gtest/avif_fuzztest_properties.cc b/tests/gtest/avif_fuzztest_properties.cc index 1a98d7acc3..7865d14aa8 100644 --- a/tests/gtest/avif_fuzztest_properties.cc +++ b/tests/gtest/avif_fuzztest_properties.cc @@ -37,12 +37,15 @@ void EncodeDecode(ImagePtr image, EncoderPtr encoder, DecoderPtr decoder, ASSERT_EQ( avifImageAddUUIDProperty(image.get(), testProp.uuid.data(), testProp.body.data(), testProp.body.size()), - AVIF_RESULT_OK); + avifIsValidUUID(testProp.uuid.data()) ? AVIF_RESULT_OK + : AVIF_RESULT_INVALID_ARGUMENT); } else { ASSERT_EQ(avifImageAddOpaqueProperty(image.get(), testProp.fourcc.data(), testProp.body.data(), testProp.body.size()), - AVIF_RESULT_OK); + avifIsKnownPropertyType(testProp.fourcc.data()) + ? AVIF_RESULT_INVALID_ARGUMENT + : AVIF_RESULT_OK); } } @@ -74,22 +77,14 @@ inline auto ArbitraryProp() { auto fourcc = fuzztest::Arbitrary>(); auto uuid = fuzztest::Arbitrary>(); // ignored auto body = fuzztest::Arbitrary>(); - // Don't return known properties. - return fuzztest::Filter( - [](const TestProp& prop) { - return !avifIsKnownPropertyType(prop.fourcc.data()); - }, - fuzztest::StructOf(fourcc, uuid, body)); + return fuzztest::StructOf(fourcc, uuid, body); } inline auto ArbitraryUUIDProp() { auto fourcc = fuzztest::Just(std::array{'u', 'u', 'i', 'd'}); auto uuid = fuzztest::Arbitrary>(); auto body = fuzztest::Arbitrary>(); - // Don't use invalid UUIDs. - return fuzztest::Filter( - [](const TestProp& prop) { return avifIsValidUUID(prop.uuid.data()); }, - fuzztest::StructOf(fourcc, uuid, body)); + return fuzztest::StructOf(fourcc, uuid, body); } inline auto ArbitraryProps() {