Fix a few instances of passing no arguments to a variadic macro. Passing no arguments to a variadic macro is incompatible with C++17. I also fixed a couple of usages of `value_type_t` on types that are not domains, but `std` containers that happen to have a member type called `value_type`. PiperOrigin-RevId: 728226687
diff --git a/domain_tests/BUILD b/domain_tests/BUILD index 6c84318..09463c2 100644 --- a/domain_tests/BUILD +++ b/domain_tests/BUILD
@@ -94,7 +94,6 @@ "@com_google_absl//absl/random", "@com_google_fuzztest//fuzztest:domain_core", "@com_google_fuzztest//fuzztest:table_of_recent_compares", - "@com_google_fuzztest//fuzztest:type_support", "@com_google_googletest//:gtest_main", ], )
diff --git a/domain_tests/CMakeLists.txt b/domain_tests/CMakeLists.txt index c7d97b1..a99142a 100644 --- a/domain_tests/CMakeLists.txt +++ b/domain_tests/CMakeLists.txt
@@ -84,7 +84,6 @@ absl::random_random fuzztest::domain_core fuzztest::table_of_recent_compares - fuzztest::type_support GTest::gmock_main )
diff --git a/domain_tests/arbitrary_domains_test.cc b/domain_tests/arbitrary_domains_test.cc index 2428759..1df4489 100644 --- a/domain_tests/arbitrary_domains_test.cc +++ b/domain_tests/arbitrary_domains_test.cc
@@ -147,7 +147,7 @@ std::optional<int>, std::unique_ptr<std::string>, MyStruct, std::vector<bool>>; -TYPED_TEST_SUITE(CompoundTypeTest, CompoundTypeTypes); +TYPED_TEST_SUITE(CompoundTypeTest, CompoundTypeTypes, ); TYPED_TEST(CompoundTypeTest, Arbitrary) { Domain<TypeParam> domain = Arbitrary<TypeParam>(); @@ -177,7 +177,7 @@ using MonostateTypeTypes = testing::Types<std::true_type, std::false_type, std::array<int, 0>, std::tuple<>>; -TYPED_TEST_SUITE(MonostateTypeTest, MonostateTypeTypes); +TYPED_TEST_SUITE(MonostateTypeTest, MonostateTypeTypes, ); TYPED_TEST(MonostateTypeTest, Arbitrary) { absl::BitGen bitgen;
diff --git a/domain_tests/container_test.cc b/domain_tests/container_test.cc index 0f361fc..d27bdd9 100644 --- a/domain_tests/container_test.cc +++ b/domain_tests/container_test.cc
@@ -35,7 +35,6 @@ #include "./fuzztest/domain_core.h" #include "./domain_tests/domain_testing.h" #include "./fuzztest/internal/table_of_recent_compares.h" -#include "./fuzztest/internal/type_support.h" namespace fuzztest { namespace { @@ -59,7 +58,7 @@ std::map<int, int>, std::unordered_map<int, int>, absl::flat_hash_map<std::string, int>>; -TYPED_TEST_SUITE(ContainerTest, ContainerTypes); +TYPED_TEST_SUITE(ContainerTest, ContainerTypes, ); TYPED_TEST(ContainerTest, Arbitrary) { using T = TypeParam; @@ -74,7 +73,7 @@ // Basic checks to make sure we have a few sizes and values. // TODO: Check these values in a more principled way. absl::flat_hash_map<size_t, size_t> size_distribution; - absl::flat_hash_map<internal::value_type_t<T>, size_t> value_distribution; + absl::flat_hash_map<typename T::value_type, size_t> value_distribution; for (const auto& s : values) { ++size_distribution[s.user_value.size()]; for (const auto& v : s.user_value) ++value_distribution[v]; @@ -151,7 +150,7 @@ TestMinMaxContainerSize(Arbitrary<T>().WithMaxSize(7), 0, 7); TestMinMaxContainerSize(Arbitrary<T>().WithMinSize(3).WithMaxSize(7), 3, 7); - auto inner = Arbitrary<internal::value_type_t<T>>(); + auto inner = Arbitrary<typename T::value_type>(); TestMinMaxContainerSize(ContainerOf<T>(inner).WithSize(7), 7, 7); TestMinMaxContainerSize(ContainerOf<T>(inner).WithMinSize(7), 7, ~size_t{}); @@ -251,7 +250,7 @@ std::vector<std::string> mutants; for (int i = 0; i < 1000000; ++i) { std::string mutant = "abcdabcdabcdabcd"; - domain.Mutate(mutant, bitgen, {.cmp_tables = &cmp_tables}, false); + domain.Mutate(mutant, bitgen, {/*cmp_tables=*/&cmp_tables}, false); mutants.push_back(std::move(mutant)); }
diff --git a/domain_tests/numeric_domains_test.cc b/domain_tests/numeric_domains_test.cc index e8cf232..8205ef8 100644 --- a/domain_tests/numeric_domains_test.cc +++ b/domain_tests/numeric_domains_test.cc
@@ -60,7 +60,7 @@ long long, unsigned long long, // NOLINT float, double, // absl::int128, absl::uint128>; -TYPED_TEST_SUITE(NumericTest, NumericTypes); +TYPED_TEST_SUITE(NumericTest, NumericTypes, ); template <typename T> class SignedNumericTest : public testing::Test {}; @@ -68,7 +68,7 @@ short, int, long, // NOLINT long long, // NOLINT float, double>; // -TYPED_TEST_SUITE(SignedNumericTest, SignedNumericTypes); +TYPED_TEST_SUITE(SignedNumericTest, SignedNumericTypes, ); TYPED_TEST(NumericTest, Arbitrary) { using T = TypeParam; @@ -275,7 +275,7 @@ class CharTest : public testing::Test {}; using CharTypes = testing::Types<char, signed char, unsigned char>; -TYPED_TEST_SUITE(CharTest, CharTypes); +TYPED_TEST_SUITE(CharTest, CharTypes, ); TYPED_TEST(CharTest, GetRandomValueYieldsEveryValue) { using T = TypeParam;
diff --git a/fuzztest/internal/type_support_test.cc b/fuzztest/internal/type_support_test.cc index 9ac88b6..08b327b 100644 --- a/fuzztest/internal/type_support_test.cc +++ b/fuzztest/internal/type_support_test.cc
@@ -14,7 +14,6 @@ #include "./fuzztest/internal/type_support.h" -#include <algorithm> #include <array> #include <cmath> #include <complex> @@ -102,7 +101,7 @@ long long, unsigned long long, // absl::int128, absl::uint128>; -TYPED_TEST_SUITE(IntegralTest, IntegralTypes); +TYPED_TEST_SUITE(IntegralTest, IntegralTypes, ); TYPED_TEST(IntegralTest, Printer) { for (auto v : {TypeParam{0}, std::numeric_limits<TypeParam>::min(), @@ -141,7 +140,7 @@ using FloatingTypes = testing::Types<float, double, long double>; -TYPED_TEST_SUITE(FloatingTest, FloatingTypes); +TYPED_TEST_SUITE(FloatingTest, FloatingTypes, ); TYPED_TEST(FloatingTest, Printer) { absl::string_view suffix = std::is_same_v<float, TypeParam> ? "f"