about summary refs log tree commit diff
path: root/absl/debugging/failure_signal_handler_test.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-11-04T15·46-0800
committerXiaoyi Zhang <zhangxy@google.com>2019-11-04T15·54-0500
commit20de2db748ca0471cfb61cb53e813dd12938c12b (patch)
treef3bd479b4ae73e0a4a302d738e6239b10b061021 /absl/debugging/failure_signal_handler_test.cc
parent846e5dbedac123d12455adcfe6f53c8b5dcbfeef (diff)
Export of internal Abseil changes
--
6ac972ce1a042a8925c20cb8b76897b018990de4 by Abseil Team <absl-team@google.com>:

Improve failure reports in signal handler test.

PiperOrigin-RevId: 278377121
GitOrigin-RevId: 6ac972ce1a042a8925c20cb8b76897b018990de4
Change-Id: I74c8cd5c633f2dc77d533556184071a9af6e2768
Diffstat (limited to 'absl/debugging/failure_signal_handler_test.cc')
-rw-r--r--absl/debugging/failure_signal_handler_test.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/absl/debugging/failure_signal_handler_test.cc b/absl/debugging/failure_signal_handler_test.cc
index bb2cc48eb4a6..863fb5149e7f 100644
--- a/absl/debugging/failure_signal_handler_test.cc
+++ b/absl/debugging/failure_signal_handler_test.cc
@@ -23,6 +23,7 @@
 #include <fstream>
 
 #include "gtest/gtest.h"
+#include "gmock/gmock.h"
 #include "absl/base/internal/raw_logging.h"
 #include "absl/debugging/stacktrace.h"
 #include "absl/debugging/symbolize.h"
@@ -31,6 +32,8 @@
 
 namespace {
 
+using testing::StartsWith;
+
 #if GTEST_HAS_DEATH_TEST
 
 // For the parameterized death tests. GetParam() returns the signal number.
@@ -113,15 +116,15 @@ TEST_P(FailureSignalHandlerDeathTest, AbslFatalSignalsWithWriterFn) {
   ASSERT_TRUE(error_output.is_open()) << file;
   std::string error_line;
   std::getline(error_output, error_line);
-  EXPECT_TRUE(absl::StartsWith(
+  EXPECT_THAT(
       error_line,
-      absl::StrCat("*** ",
-                   absl::debugging_internal::FailureSignalToString(signo),
-                   " received at ")));
+      StartsWith(absl::StrCat(
+          "*** ", absl::debugging_internal::FailureSignalToString(signo),
+          " received at ")));
 
   if (absl::debugging_internal::StackTraceWorksForTest()) {
     std::getline(error_output, error_line);
-    EXPECT_TRUE(absl::StartsWith(error_line, "PC: "));
+    EXPECT_THAT(error_line, StartsWith("PC: "));
   }
 }