about summary refs log tree commit diff
path: root/absl/flags/flag_test.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-04-22T17·52-0700
committerDerek Mauro <dmauro@google.com>2020-04-22T18·03+0000
commit902909a430e2558ad446294159af39bf019a1ef6 (patch)
tree1efe99ef701d2afad97677797e977cdac40cce50 /absl/flags/flag_test.cc
parentcb52b05ea20e8d196f17b45a420c2d323e401324 (diff)
Export of internal Abseil changes
--
692d3df279e7592d01c1008cb85f2a010c3d17da by Abseil Team <absl-team@google.com>:

Use EXPECT_DEATH_IF_SUPPORTED instead of raw EXPECT_DEATH.

PiperOrigin-RevId: 307802196

--
ebc40936b677b79cad9f87f944794c35946f9dbd by Gennadiy Rozental <rogeeff@google.com>:

Eliminate SetCallback from absl::Flag<T> public interface.

We also make SetCallback on FlagRegistrar to return rvalue, so that we can add more tail calls after it.

PiperOrigin-RevId: 307745935
GitOrigin-RevId: 15f69a9dae9c70c884ce85ca1a4bf359a2609db0
Change-Id: Ibec13463e44e4071c48fb12389f47e716cee7a9d
Diffstat (limited to 'absl/flags/flag_test.cc')
-rw-r--r--absl/flags/flag_test.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/absl/flags/flag_test.cc b/absl/flags/flag_test.cc
index dbe94a2c3b62..6fa178f1f0b9 100644
--- a/absl/flags/flag_test.cc
+++ b/absl/flags/flag_test.cc
@@ -583,18 +583,21 @@ using FlagDeathTest = FlagTest;
 
 TEST_F(FlagDeathTest, TestTypeMismatchValidations) {
 #if !defined(NDEBUG)
-  EXPECT_DEATH(static_cast<void>(absl::GetFlag(FLAGS_mistyped_int_flag)),
-               "Flag 'mistyped_int_flag' is defined as one type and declared "
-               "as another");
-  EXPECT_DEATH(static_cast<void>(absl::GetFlag(FLAGS_mistyped_string_flag)),
-               "Flag 'mistyped_string_flag' is defined as one type and "
-               "declared as another");
+  EXPECT_DEATH_IF_SUPPORTED(
+      static_cast<void>(absl::GetFlag(FLAGS_mistyped_int_flag)),
+      "Flag 'mistyped_int_flag' is defined as one type and declared "
+      "as another");
+  EXPECT_DEATH_IF_SUPPORTED(
+      static_cast<void>(absl::GetFlag(FLAGS_mistyped_string_flag)),
+      "Flag 'mistyped_string_flag' is defined as one type and "
+      "declared as another");
 #endif
 
-  EXPECT_DEATH(absl::SetFlag(&FLAGS_mistyped_int_flag, 1),
-               "Flag 'mistyped_int_flag' is defined as one type and declared "
-               "as another");
-  EXPECT_DEATH(
+  EXPECT_DEATH_IF_SUPPORTED(
+      absl::SetFlag(&FLAGS_mistyped_int_flag, 1),
+      "Flag 'mistyped_int_flag' is defined as one type and declared "
+      "as another");
+  EXPECT_DEATH_IF_SUPPORTED(
       absl::SetFlag(&FLAGS_mistyped_string_flag, std::vector<std::string>{}),
       "Flag 'mistyped_string_flag' is defined as one type and declared as "
       "another");