diff options
Diffstat (limited to 'absl/flags/flag_test.cc')
-rw-r--r-- | absl/flags/flag_test.cc | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/absl/flags/flag_test.cc b/absl/flags/flag_test.cc index 465f018c5e4f..28c513b020a8 100644 --- a/absl/flags/flag_test.cc +++ b/absl/flags/flag_test.cc @@ -43,16 +43,16 @@ template <typename T> bool TestConstructionFor() { constexpr flags::HelpInitArg help_arg{flags::FlagHelpSrc("literal help"), flags::FlagHelpSrcKind::kLiteral}; - constexpr flags::Flag<T> f1("f1", help_arg, "file", - &flags::FlagMarshallingOps<T>, &TestMakeDflt<T>); + constexpr flags::Flag<T> f1("f1", "file", &flags::FlagMarshallingOps<T>, + help_arg, &TestMakeDflt<T>); EXPECT_EQ(f1.Name(), "f1"); EXPECT_EQ(f1.Help(), "literal help"); EXPECT_EQ(f1.Filename(), "file"); ABSL_CONST_INIT static flags::Flag<T> f2( - "f2", + "f2", "file", &flags::FlagMarshallingOps<T>, {flags::FlagHelpSrc(&TestHelpMsg), flags::FlagHelpSrcKind::kGenFunc}, - "file", &flags::FlagMarshallingOps<T>, &TestMakeDflt<T>); + &TestMakeDflt<T>); flags::FlagRegistrar<T, false>(&f2).OnUpdate(TestCallback); EXPECT_EQ(f2.Name(), "f2"); @@ -486,30 +486,11 @@ TEST_F(FlagTest, TestNonDefaultConstructibleType) { // -------------------------------------------------------------------- -struct Wrapper { - Wrapper() {} - - // NOLINTNEXTLINE(runtime/explicit) - Wrapper(const std::string& val) : val(val) {} - - // NOLINTNEXTLINE(runtime/explicit) - template <typename T> - Wrapper(T&& t) : val(std::forward<T>(t)) {} - - // NOLINTNEXTLINE(runtime/explicit) - operator std::string() const& { return val; } - - std::string val; -}; - } // namespace ABSL_RETIRED_FLAG(bool, old_bool_flag, true, "old descr"); ABSL_RETIRED_FLAG(int, old_int_flag, (int)std::sqrt(10), "old descr"); ABSL_RETIRED_FLAG(std::string, old_str_flag, "", absl::StrCat("old ", "descr")); -ABSL_RETIRED_FLAG(Wrapper, old_wrapper_flag, {}, "old wrapper"); -ABSL_RETIRED_FLAG(Wrapper, old_wrapper_no_default_flag, , - "old wrapper no default"); namespace { @@ -521,10 +502,6 @@ TEST_F(FlagTest, TestRetiredFlagRegistration) { EXPECT_FALSE(is_bool); EXPECT_TRUE(flags::IsRetiredFlag("old_str_flag", &is_bool)); EXPECT_FALSE(is_bool); - EXPECT_TRUE(flags::IsRetiredFlag("old_wrapper_flag", &is_bool)); - EXPECT_FALSE(is_bool); - EXPECT_TRUE(flags::IsRetiredFlag("old_wrapper_no_default_flag", &is_bool)); - EXPECT_FALSE(is_bool); EXPECT_FALSE(flags::IsRetiredFlag("some_other_flag", &is_bool)); } |