- 31d03284ca8017ba59d98d47e7d041f361d478a7 Release escaping microbenchmarks. by Alex Strelnikov <strel@google.com>

- f183ce453db49ebc1948bb1d8eced37021cf63f7 Internal change. by Derek Mauro <dmauro@google.com>
  - b1660cb93e0fa37cdcecf37642766f5bfd12c7b0 Improve compatibility of some cc_test targets for portabl... by Abseil Team <absl-team@google.com>

GitOrigin-RevId: 31d03284ca8017ba59d98d47e7d041f361d478a7
Change-Id: I9c4c4d2ad12cfe10c914f7cfa9aaab67fcef5cb1
This commit is contained in:
Abseil Team 2018-05-24 10:33:14 -07:00 committed by katzdm
parent 014f02a3ec
commit 99477fa9f1
11 changed files with 189 additions and 14 deletions

View file

@ -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