From 3391f9e9929d6ea2562863902cb523af3e47f3f5 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 22 Nov 2025 15:19:48 -0800 Subject: [PATCH] Cleanup test --- test/format-test.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/format-test.cc b/test/format-test.cc index 1b4fc4a1..b7496085 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -2036,9 +2036,6 @@ TEST(format_test, unpacked_args) { 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g')); } -constexpr char with_null[3] = {'{', '}', '\0'}; -static constexpr char static_with_null[3] = {'{', '}', '\0'}; - TEST(format_test, compile_time_string) { EXPECT_EQ(fmt::format(FMT_STRING("foo")), "foo"); EXPECT_EQ(fmt::format(FMT_STRING("{}"), 42), "42"); @@ -2053,15 +2050,12 @@ TEST(format_test, compile_time_string) { EXPECT_EQ(fmt::format(FMT_STRING("{} {two}"), 1, "two"_a = 2), "1 2"); #endif - (void)static_with_null; + static constexpr char format_str[3] = {'{', '}', '\0'}; + (void)format_str; #ifndef _MSC_VER - EXPECT_EQ(fmt::format(FMT_STRING(static_with_null), 42), "42"); + EXPECT_EQ(fmt::format(FMT_STRING(format_str), 42), "42"); #endif - (void)with_null; -#if FMT_CPLUSPLUS >= 201703L - EXPECT_EQ(fmt::format(FMT_STRING(with_null), 42), "42"); -#endif #if defined(FMT_USE_STRING_VIEW) && FMT_CPLUSPLUS >= 201703L EXPECT_EQ(fmt::format(FMT_STRING(std::string_view("{}")), 42), "42"); #endif