about summary refs log tree commit diff
path: root/absl/strings/str_cat_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/strings/str_cat_test.cc')
-rw-r--r--absl/strings/str_cat_test.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/absl/strings/str_cat_test.cc b/absl/strings/str_cat_test.cc
index c86a5952fab0..e9d676906382 100644
--- a/absl/strings/str_cat_test.cc
+++ b/absl/strings/str_cat_test.cc
@@ -22,6 +22,15 @@
 #include "gtest/gtest.h"
 #include "absl/strings/substitute.h"
 
+#ifdef __ANDROID__
+// Android assert messages only go to system log, so death tests cannot inspect
+// the message for matching.
+#define ABSL_EXPECT_DEBUG_DEATH(statement, regex) \
+  EXPECT_DEBUG_DEATH(statement, ".*")
+#else
+#define ABSL_EXPECT_DEBUG_DEATH EXPECT_DEBUG_DEATH
+#endif
+
 namespace {
 
 // Test absl::StrCat of ints and longs of various sizes and signdedness.
@@ -396,8 +405,9 @@ TEST(StrAppend, Death) {
   std::string s = "self";
   // on linux it's "assertion", on mac it's "Assertion",
   // on chromiumos it's "Assertion ... failed".
-  EXPECT_DEBUG_DEATH(absl::StrAppend(&s, s.c_str() + 1), "ssertion.*failed");
-  EXPECT_DEBUG_DEATH(absl::StrAppend(&s, s), "ssertion.*failed");
+  ABSL_EXPECT_DEBUG_DEATH(absl::StrAppend(&s, s.c_str() + 1),
+                          "ssertion.*failed");
+  ABSL_EXPECT_DEBUG_DEATH(absl::StrAppend(&s, s), "ssertion.*failed");
 }
 #endif  // GTEST_HAS_DEATH_TEST