- 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:
parent
014f02a3ec
commit
99477fa9f1
11 changed files with 189 additions and 14 deletions
|
|
@ -29,6 +29,15 @@
|
|||
#include "absl/base/config.h"
|
||||
#include "absl/base/dynamic_annotations.h"
|
||||
|
||||
#ifdef __ANDROID__
|
||||
// Android assert messages only go to system log, so death tests cannot inspect
|
||||
// the message for matching.
|
||||
#define ABSL_EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
|
||||
EXPECT_DEATH_IF_SUPPORTED(statement, ".*")
|
||||
#else
|
||||
#define ABSL_EXPECT_DEATH_IF_SUPPORTED EXPECT_DEATH_IF_SUPPORTED
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
// A minimal allocator that uses malloc().
|
||||
|
|
@ -1068,7 +1077,8 @@ TEST(HugeStringView, TwoPointTwoGB) {
|
|||
|
||||
#if !defined(NDEBUG) && !defined(ABSL_HAVE_STD_STRING_VIEW)
|
||||
TEST(NonNegativeLenTest, NonNegativeLen) {
|
||||
EXPECT_DEATH_IF_SUPPORTED(absl::string_view("xyz", -1), "len <= kMaxSize");
|
||||
ABSL_EXPECT_DEATH_IF_SUPPORTED(absl::string_view("xyz", -1),
|
||||
"len <= kMaxSize");
|
||||
}
|
||||
|
||||
TEST(LenExceedsMaxSizeTest, LenExceedsMaxSize) {
|
||||
|
|
@ -1078,8 +1088,8 @@ TEST(LenExceedsMaxSizeTest, LenExceedsMaxSize) {
|
|||
absl::string_view ok_view("", max_size);
|
||||
|
||||
// Adding one to the max should trigger an assertion.
|
||||
EXPECT_DEATH_IF_SUPPORTED(absl::string_view("", max_size + 1),
|
||||
"len <= kMaxSize");
|
||||
ABSL_EXPECT_DEATH_IF_SUPPORTED(absl::string_view("", max_size + 1),
|
||||
"len <= kMaxSize");
|
||||
}
|
||||
#endif // !defined(NDEBUG) && !defined(ABSL_HAVE_STD_STRING_VIEW)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue