Skip to content

Commit b742bb0

Browse files
lszekerescopybara-github
authored andcommitted
Change instances of FUZZTEST_CHECK(false) to FUZZTEST_LOG(FATAL).
PiperOrigin-RevId: 797441433
1 parent e91ddf2 commit b742bb0

File tree

11 files changed

+22
-23
lines changed

11 files changed

+22
-23
lines changed

centipede/centipede_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,14 +358,14 @@ class MutateCallbacks : public CentipedeCallbacks {
358358
// Will not be called.
359359
bool Execute(std::string_view binary, const std::vector<ByteArray> &inputs,
360360
BatchResult &batch_result) override {
361-
FUZZTEST_CHECK(false);
361+
FUZZTEST_LOG(FATAL);
362362
return false;
363363
}
364364

365365
// Will not be called.
366366
std::vector<ByteArray> Mutate(const std::vector<MutationInputRef> &inputs,
367367
size_t num_mutants) override {
368-
FUZZTEST_CHECK(false);
368+
FUZZTEST_LOG(FATAL);
369369
}
370370

371371
// Redeclare a protected member function as public so the tests can call it.

common/status_macros.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ decltype(auto) ValueOrDie(T&& value ABSL_ATTRIBUTE_LIFETIME_BOUND,
5555
std::uint_least32_t line = __builtin_LINE(),
5656
const char* file_name = __builtin_FILE()) {
5757
if (ABSL_PREDICT_FALSE(!value.ok())) {
58-
FUZZTEST_CHECK(false) << file_name << ":" << line
59-
<< ": ValueOrDie on non-OK status: "
60-
<< value.status();
58+
FUZZTEST_LOG(FATAL) << file_name << ":" << line
59+
<< ": ValueOrDie on non-OK status: " << value.status();
6160
}
6261
return *std::forward<T>(value);
6362
}

common/temp_dir.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ TempDir::TempDir(absl::string_view custom_prefix) {
2626
#if !defined(_MSC_VER)
2727
path_ = mkdtemp(path_template.string().data());
2828
#else
29-
FUZZTEST_CHECK(false) << "Windows is not supported yet.";
29+
FUZZTEST_LOG(FATAL) << "Windows is not supported yet.";
3030
#endif
3131
FUZZTEST_CHECK(std::filesystem::is_directory(path_));
3232
}

e2e_tests/benchmark_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void RunMicrobenchmarks(const bool list_tests, const std::string& filter) {
228228
int main(int argc, char** argv) {
229229
#if defined(__has_feature)
230230
#if !__has_feature(coverage_sanitizer)
231-
FUZZTEST_CHECK(false) << "\n\nPlease compile with --config=fuzztest.\n";
231+
FUZZTEST_LOG(FATAL) << "\n\nPlease compile with --config=fuzztest.\n";
232232
#endif
233233
#endif
234234
absl::ParseCommandLine(argc, argv);

e2e_tests/corpus_database_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ class UpdateCorpusDatabaseTest
8080
static void SetUpTestSuite() {
8181
#if defined(__has_feature)
8282
#if !__has_feature(address_sanitizer)
83-
FUZZTEST_CHECK(false)
83+
FUZZTEST_LOG(FATAL)
8484
<< "The test binary is not built with ASAN. Please run with "
8585
"--config=asan.";
8686
#elif !__has_feature(coverage_sanitizer) || !defined(FUZZTEST_USE_CENTIPEDE)
87-
FUZZTEST_CHECK(false) << "The test binary is not built with coverage "
88-
"instrumentation for Centipede. "
87+
FUZZTEST_LOG(FATAL) << "The test binary is not built with coverage "
88+
"instrumentation for Centipede. "
8989
"Please run with --config=fuzztest-experimental.";
9090
#endif
9191
#endif

e2e_tests/functional_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ class FuzzingModeFixtureTest
13201320
return RunBinary(CentipedePath(), run_options);
13211321
}
13221322
}
1323-
FUZZTEST_CHECK(false) << "Unsupported execution model!\n";
1323+
FUZZTEST_LOG(FATAL) << "Unsupported execution model!\n";
13241324
}
13251325
};
13261326

fuzztest/internal/centipede_adaptor.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,8 @@ absl::Status ExportReproducersFromCentipede(
800800
output.dir_path);
801801
break;
802802
default:
803-
FUZZTEST_CHECK(false) << "unsupported reproducer output location type "
804-
"to report reproducers from Centipede";
803+
FUZZTEST_LOG(FATAL) << "unsupported reproducer output location type "
804+
"to report reproducers from Centipede";
805805
}
806806

807807
// Will be set when there is only one reproducer - nullopt otherwise.

fuzztest/internal/domains/in_grammar_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ class InGrammarImpl
746746
}
747747

748748
std::optional<corpus_type> FromValue(const value_type& /*v*/) const {
749-
FUZZTEST_CHECK(false) << "Parsing is not implemented yet!";
749+
FUZZTEST_LOG(FATAL) << "Parsing is not implemented yet!";
750750
return std::nullopt;
751751
}
752752

fuzztest/internal/domains/protobuf_domain_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,7 @@ class ProtobufDomainUntypedImpl
19191919
return policy_.GetMinRepeatedFieldSize(field).has_value() &&
19201920
*policy_.GetMinRepeatedFieldSize(field) > 0;
19211921
}
1922-
FUZZTEST_CHECK(false) << "Field is not optional, repeated, or required";
1922+
FUZZTEST_LOG(FATAL) << "Field is not optional, repeated, or required";
19231923
return false;
19241924
}
19251925

@@ -1942,7 +1942,7 @@ class ProtobufDomainUntypedImpl
19421942
return policy_.GetMaxRepeatedFieldSize(field).has_value() &&
19431943
*policy_.GetMaxRepeatedFieldSize(field) == 0;
19441944
}
1945-
FUZZTEST_CHECK(false) << "Field is not optional, repeated, or required";
1945+
FUZZTEST_LOG(FATAL) << "Field is not optional, repeated, or required";
19461946
return false;
19471947
}
19481948

fuzztest/internal/runtime.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ void PrintReproducerIfRequested(RawSink out, const FuzzTest& test,
218218
Basename(reproducer_path));
219219
break;
220220
default:
221-
FUZZTEST_CHECK(false) << "unsupported reproducer output location type "
222-
"to print reproduction command for";
221+
FUZZTEST_LOG(FATAL) << "unsupported reproducer output location type "
222+
"to print reproduction command for";
223223
}
224224
}
225225
absl::Format(

0 commit comments

Comments
 (0)