aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util/fuzzer_corpus_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/util/fuzzer_corpus_test.cc')
-rw-r--r--test/core/util/fuzzer_corpus_test.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/core/util/fuzzer_corpus_test.cc b/test/core/util/fuzzer_corpus_test.cc
index a5e99a1bac..d7aea54262 100644
--- a/test/core/util/fuzzer_corpus_test.cc
+++ b/test/core/util/fuzzer_corpus_test.cc
@@ -32,6 +32,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
extern "C" bool squelch;
extern "C" bool leak_check;
+// In some distros, gflags is in the namespace google, and in some others,
+// in gflags. This hack is enabling us to find both.
+namespace google {}
+namespace gflags {}
+using namespace google;
+using namespace gflags;
+
DEFINE_string(file, "", "Use this file as test data");
DEFINE_string(directory, "", "Use this directory as test data");
@@ -65,7 +72,7 @@ class ExampleGenerator
struct dirent* ep;
dp = opendir(FLAGS_directory.c_str());
- if (dp != NULL) {
+ if (dp != nullptr) {
while ((ep = readdir(dp)) != nullptr) {
if (ep->d_type == DT_REG) {
examples_.push_back(FLAGS_directory + "/" + ep->d_name);
@@ -129,7 +136,7 @@ INSTANTIATE_TEST_CASE_P(
int main(int argc, char** argv) {
grpc_test_init(argc, argv);
- ::gflags::ParseCommandLineFlags(&argc, &argv, true);
+ ParseCommandLineFlags(&argc, &argv, true);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();