Skip to content

Commit

Permalink
Fix the inherited Fuzzer class for the compatibility mode.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 718374858
  • Loading branch information
xinhaoyuan authored and copybara-github committed Jan 22, 2025
1 parent 130dd97 commit edd030b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions fuzztest/internal/compatibility_mode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ FuzzTestExternalEngineAdaptor::FuzzTestExternalEngineAdaptor(
const FuzzTest& test, std::unique_ptr<Driver> fixture_driver)
: test_(test), fixture_driver_staging_(std::move(fixture_driver)) {}

void FuzzTestExternalEngineAdaptor::RunInUnitTestMode(
bool FuzzTestExternalEngineAdaptor::RunInUnitTestMode(
const Configuration& configuration) {
GetFuzzerImpl().RunInUnitTestMode(configuration);
return GetFuzzerImpl().RunInUnitTestMode(configuration);
}

int FuzzTestExternalEngineAdaptor::RunInFuzzingMode(
bool FuzzTestExternalEngineAdaptor::RunInFuzzingMode(
int* argc, char*** argv, const Configuration& configuration) {
FUZZTEST_INTERNAL_CHECK(&LLVMFuzzerRunDriver,
"LibFuzzer Driver API not defined.");
Expand Down Expand Up @@ -101,7 +101,7 @@ int FuzzTestExternalEngineAdaptor::RunInFuzzingMode(
"Invalid fixture driver!");
impl.fixture_driver_->TearDownFuzzTest();

return 0;
return true;
}

// External engine callbacks.
Expand Down
6 changes: 3 additions & 3 deletions fuzztest/internal/compatibility_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class FuzzTestExternalEngineAdaptor : public FuzzTestFuzzer,

FuzzTestExternalEngineAdaptor(const FuzzTest& test,
std::unique_ptr<Driver> fixture_driver);
void RunInUnitTestMode(const Configuration& configuration) override;
int RunInFuzzingMode(int* argc, char*** argv,
const Configuration& configuration) override;
bool RunInUnitTestMode(const Configuration& configuration) override;
bool RunInFuzzingMode(int* argc, char*** argv,
const Configuration& configuration) override;

// External engine callbacks.

Expand Down

0 comments on commit edd030b

Please sign in to comment.