diff options
author | Abseil Team <absl-team@google.com> | 2022-03-01 13:02:10 -0800 |
---|---|---|
committer | dinord <dino.radakovich@gmail.com> | 2022-03-02 16:54:53 -0500 |
commit | 1dd160f9f091ac30fc83326306b96827ca32c3cd (patch) | |
tree | cbfb302a3f5d30d370057f720bb06879593e0f31 /absl/flags/flag_test.cc | |
parent | 5e4ea1ce097f3571e7d87af33b6b30d11b3a211e (diff) |
Export of internal Abseil changes
--
f0b7d230a90c82c6fee7adcb46a213d2582b6a7b by Martijn Vels <mvels@google.com>:
Optimize substring logic now that CONCAT is removed
This CL adds a static Substring() method to CordRepSubstring, and implements substring logic in cord.cc in terms of the new function. This cleans up various helper functions and logic remaining from previous complex CONCAT logic that is no longer needed.
PiperOrigin-RevId: 431756805
Change-Id: I39c875b5af119916780e68598c7fc619fb2e8476
--
fa7d1bedf0e1244303844869a332c2a5dbd9ac0f by Derek Mauro <dmauro@google.com>:
Allow macro expansion within ABSL_FLAG and ABSL_DECLARE_FLAG args
PiperOrigin-RevId: 431721184
Change-Id: I6e19713fb541205d796f940998db5ee25178d55e
--
1b328badd92304ed1c634f23e1c191be57b7bb15 by Laramie Leavitt <lar@google.com>:
Add #include for std:: types
PiperOrigin-RevId: 431546757
Change-Id: I75efbcd3c77e6f53e4db66494101d30d670d988e
--
e25323b299d4d3840218702860f537cdd2a3926f by Thomas Köppe <tkoeppe@google.com>:
Add hashing support for pointers to member.
Also add tests for function pointers to the existing "pointer" test.
PiperOrigin-RevId: 431067588
Change-Id: I3686010635d9fee34c47a418b72402e10737cdbc
--
ab27b012a61cf10109fd51932b3b0b05ee78f32f by Laramie Leavitt <lar@google.com>:
Avoid use of std::pow in ChiSquare test.
PiperOrigin-RevId: 431015830
Change-Id: Idd767ff2f51009ee171de48757207b38330ffea3
--
28c359135d89061177958580fe4a7493802499cb by Laramie Leavitt <lar@google.com>:
Add #include <type_traits> for std::false_type
PiperOrigin-RevId: 431005757
Change-Id: I85a6a918778601e19512aaea744424cf39018521
--
a920730f23669479d92e3a696d65d0bc3a5b1de1 by Laramie Leavitt <lar@google.com>:
#include <utility> for std::declval
PiperOrigin-RevId: 431004934
Change-Id: I295237b2d44e9a15e4083698ea121b68ce0a1bb7
GitOrigin-RevId: f0b7d230a90c82c6fee7adcb46a213d2582b6a7b
Diffstat (limited to 'absl/flags/flag_test.cc')
-rw-r--r-- | absl/flags/flag_test.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/absl/flags/flag_test.cc b/absl/flags/flag_test.cc index 6e974a5b..ced332d4 100644 --- a/absl/flags/flag_test.cc +++ b/absl/flags/flag_test.cc @@ -977,3 +977,16 @@ TEST_F(FlagTest, TesTypeWrappingEnum) { value = absl::GetFlag(FLAGS_test_enum_wrapper_flag); EXPECT_EQ(value.e, B); } + +// This is a compile test to ensure macros are expanded within ABSL_FLAG and +// ABSL_DECLARE_FLAG. +#define FLAG_NAME_MACRO(name) prefix_ ## name +ABSL_DECLARE_FLAG(int, FLAG_NAME_MACRO(test_macro_named_flag)); +ABSL_FLAG(int, FLAG_NAME_MACRO(test_macro_named_flag), 0, + "Testing macro expansion within ABSL_FLAG"); + +TEST_F(FlagTest, MacroWithinAbslFlag) { + EXPECT_EQ(absl::GetFlag(FLAGS_prefix_test_macro_named_flag), 0); + absl::SetFlag(&FLAGS_prefix_test_macro_named_flag, 1); + EXPECT_EQ(absl::GetFlag(FLAGS_prefix_test_macro_named_flag), 1); +} |