Skip to content

Commit

Permalink
Revert "GetSeedDataDirs: allow TEST_DATA_DIRS to be -D defined (AOMed…
Browse files Browse the repository at this point in the history
…iaCodec#2162)"

This reverts commit d369ffb.

This change was meant to allow the fuzz tests to be run by Chrome's
ClusterFuzz, but the source tree is unavailable in the fuzzer
environment and there is no way to copy the data currently. Adding the
ability for the latter was also discouraged by the security/clusterfuzz
team.
  • Loading branch information
jzern committed Jun 7, 2024
1 parent 7fbc20c commit 873191d
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions tests/gtest/avif_fuzztest_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,9 @@ ::testing::Environment* SetEnv(const char* name, const char* value) {

//------------------------------------------------------------------------------

#ifdef TEST_DATA_DIRS
// Helper macros to ensure TEST_DATA_DIRS is a quoted string.
// NOTE: TEST_DATA_DIRS must NOT be a quoted string before stringification
// otherwise it will be quoted twice, resulting in the use of an incorrect path.
#define AVIF_TO_STRING(S) #S
#define AVIF_STRINGIFY(S) AVIF_TO_STRING(S)
#endif

std::vector<std::string> GetSeedDataDirs() {
const char* var = std::getenv("TEST_DATA_DIRS");
std::vector<std::string> res;
#ifdef TEST_DATA_DIRS
if (var == nullptr) {
var = AVIF_STRINGIFY(TEST_DATA_DIRS);
}
#endif
if (var == nullptr || *var == 0) return res;
const char* var_start = var;
while (true) {
Expand All @@ -252,9 +239,6 @@ std::vector<std::string> GetSeedDataDirs() {
return res;
}

#undef AVIF_STRINGIFY
#undef AVIF_TO_STRING

std::vector<std::string> GetTestImagesContents(
size_t max_file_size, const std::vector<avifAppFileFormat>& image_formats) {
// Use an environment variable to get the test data directory because
Expand Down

0 comments on commit 873191d

Please sign in to comment.