summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest-death-test.cc
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2018-02-09 15:41:09 (GMT)
committerGennadiy Civil <misterg@google.com>2018-02-09 15:41:09 (GMT)
commitec7faa943d7817c81ce7bdf71a21ebc9244dc8de (patch)
tree93570e0098d107f38417c6524b79c26dbda37120 /googletest/src/gtest-death-test.cc
parenta3c73ed28d7995b18d48027aee740ad827fcc157 (diff)
downloadgoogletest-ec7faa943d7817c81ce7bdf71a21ebc9244dc8de.zip
googletest-ec7faa943d7817c81ce7bdf71a21ebc9244dc8de.tar.gz
googletest-ec7faa943d7817c81ce7bdf71a21ebc9244dc8de.tar.bz2
Diffstat (limited to 'googletest/src/gtest-death-test.cc')
-rw-r--r--googletest/src/gtest-death-test.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/googletest/src/gtest-death-test.cc b/googletest/src/gtest-death-test.cc
index 2bbb1bc..00e231b 100644
--- a/googletest/src/gtest-death-test.cc
+++ b/googletest/src/gtest-death-test.cc
@@ -73,7 +73,7 @@ namespace testing {
// Constants.
// The default death test style.
-static const char kDefaultDeathTestStyle[] = "fast";
+static const char kDefaultDeathTestStyle[] = "threadsafe";
GTEST_DEFINE_string_(
death_test_style,
@@ -555,7 +555,13 @@ bool DeathTestImpl::Passed(bool status_ok) {
break;
case DIED:
if (status_ok) {
+# if GTEST_USES_PCRE
+ // PCRE regexes support embedded NULs.
+ // GTEST_USES_PCRE is defined only in google3 mode
+ const bool matched = RE::PartialMatch(error_message, *regex());
+# else
const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
+# endif // GTEST_USES_PCRE
if (matched) {
success = true;
} else {