From a8bcf81f72fe2b73e326a5d9b0525361ec62786d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 3 Sep 2024 18:31:39 -0700 Subject: [PATCH] Minor cleanup --- test/base-test.cc | 59 ++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/test/base-test.cc b/test/base-test.cc index 5c3f91ca..96dbd9d7 100644 --- a/test/base-test.cc +++ b/test/base-test.cc @@ -624,47 +624,45 @@ FMT_END_NAMESPACE enum class unformattable_scoped_enum {}; TEST(base_test, is_formattable) { - static_assert(!fmt::is_formattable::value, ""); + EXPECT_FALSE(fmt::is_formattable::value); #ifdef __cpp_char8_t - static_assert(!fmt::is_formattable::value, ""); + EXPECT_FALSE(fmt::is_formattable::value); #endif - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable>::value, - ""); - static_assert(fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, - ""); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable>::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); - static_assert(fmt::is_formattable::value, ""); - static_assert(fmt::is_formattable::value, ""); + EXPECT_TRUE(fmt::is_formattable::value); + EXPECT_TRUE(fmt::is_formattable::value); + EXPECT_TRUE(fmt::is_formattable::value); - static_assert(fmt::is_formattable::value, ""); + EXPECT_TRUE(fmt::is_formattable::value); #if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910 - static_assert(!fmt::is_formattable::value, ""); + EXPECT_FALSE(fmt::is_formattable::value); #endif - static_assert(!fmt::is_formattable::value, ""); + EXPECT_FALSE(fmt::is_formattable::value); const auto f = convertible_to_pointer_formattable(); auto str = std::string(); fmt::format_to(std::back_inserter(str), "{}", f); EXPECT_EQ(str, "test"); - static_assert(!fmt::is_formattable::value, ""); + EXPECT_FALSE(fmt::is_formattable::value); struct s; - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); - static_assert(!fmt::is_formattable::value, ""); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); + EXPECT_FALSE(fmt::is_formattable::value); } #ifdef __cpp_concepts @@ -788,10 +786,9 @@ TEST(base_test, format_explicitly_convertible_to_std_string_view) { #endif TEST(base_test, has_const_formatter) { - EXPECT_TRUE((fmt::detail::has_const_formatter())); - EXPECT_FALSE((fmt::detail::has_const_formatter())); + EXPECT_TRUE((fmt::detail::has_const_formatter())); + EXPECT_FALSE( + (fmt::detail::has_const_formatter())); } TEST(base_test, format_nonconst) {