From 9a7e8e36300c6d89c7f9a2539f7aabf8e0031106 Mon Sep 17 00:00:00 2001 From: Andy Getzendanner Date: Mon, 21 Nov 2022 21:17:53 -0800 Subject: Zero encoded_remaining when a string field doesn't fit, so that we don't leave partial data in the buffer (all decoders should ignore it anyway) and to be sure that we don't try to put any subsequent operands in either (there shouldn't be enough space). PiperOrigin-RevId: 490143656 Change-Id: I4d743dd9214013fbd151478ef662d50affd5ff7a --- absl/log/internal/test_matchers.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'absl/log/internal/test_matchers.h') diff --git a/absl/log/internal/test_matchers.h b/absl/log/internal/test_matchers.h index c18cb6e9..fc653a91 100644 --- a/absl/log/internal/test_matchers.h +++ b/absl/log/internal/test_matchers.h @@ -38,6 +38,10 @@ namespace absl { ABSL_NAMESPACE_BEGIN namespace log_internal { +// In some configurations, Googletest's string matchers (e.g. +// `::testing::EndsWith`) need help to match `absl::string_view`. +::testing::Matcher AsString( + const ::testing::Matcher& str_matcher); // These matchers correspond to the components of `absl::LogEntry`. ::testing::Matcher SourceFilename( @@ -79,6 +83,8 @@ namespace log_internal { const std::ostringstream& stream); ::testing::Matcher DeathTestValidateExpectations(); +::testing::Matcher RawEncodedMessage( + const ::testing::Matcher& raw_encoded_message); #define ENCODED_MESSAGE(message_matcher) ::testing::_ } // namespace log_internal -- cgit v1.2.3