message: tests: Add FuzzedAutoFileProvider which provides a CAutoFile interface to FuzzedDataProvider
diff: @@ -383,4 +383,25 @@ NODISCARD inline FuzzedFileProvider ConsumeFile(FuzzedDataProvider& fuzzed_data_
  return {fuzzed_data_provider};
  }
  +class FuzzedAutoFileProvider
  +{
  + FuzzedDataProvider& m_fuzzed_data_provider;
  + FuzzedFileProvider m_fuzzed_file_provider;
  +
  +public:
  + FuzzedAutoFileProvider(FuzzedDataProvider& fuzzed_data_provider) : m_fuzzed_data_provider{fuzzed_data_provider}, m_fuzzed_file_provider{fuzzed_data_provider}
  + {
  + }
  +
  + CAutoFile open()
  + {
  + return {m_fuzzed_file_provider.open(), m_fuzzed_data_provider.ConsumeIntegral<int>(), m_fuzzed_data_provider.ConsumeIntegral<int>()};
  + }
  +};
  +
  +NODISCARD inline FuzzedAutoFileProvider ConsumeAutoFile(FuzzedDataProvider& fuzzed_data_provider) noexcept
  +{
  + return {fuzzed_data_provider};
  +}
  +
  #endif // BITCOIN_TEST_FUZZ_UTIL_H
  