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() {