aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/test/googletest-death-test-test.cc
diff options
context:
space:
mode:
authordurandal <durandal@google.com>2018-11-15 16:09:09 -0500
committerGennadiy Civil <misterg@google.com>2018-11-20 13:29:20 -0500
commit8e86f67261649621baf39e8c4368ae224c2193f6 (patch)
tree41afe840295ed259b9baceeee7742b7a4ced2a99 /googletest/test/googletest-death-test-test.cc
parentaac18185ebb4c88d6df5dd4a40d553abf6b9792d (diff)
downloadgoogletest-8e86f67261649621baf39e8c4368ae224c2193f6.tar.gz
googletest-8e86f67261649621baf39e8c4368ae224c2193f6.tar.bz2
googletest-8e86f67261649621baf39e8c4368ae224c2193f6.zip
Googletest export
Move the Matcher<T> interface to googletest so I can use it to extend death test regex matching in a subsequent change. PiperOrigin-RevId: 221675910
Diffstat (limited to 'googletest/test/googletest-death-test-test.cc')
-rw-r--r--googletest/test/googletest-death-test-test.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/googletest/test/googletest-death-test-test.cc b/googletest/test/googletest-death-test-test.cc
index a81702c0..f92bb1a6 100644
--- a/googletest/test/googletest-death-test-test.cc
+++ b/googletest/test/googletest-death-test-test.cc
@@ -499,6 +499,10 @@ TEST_F(TestForDeathTest, AcceptsAnythingConvertibleToRE) {
const ::string regex_str(regex_c_str);
EXPECT_DEATH(GlobalFunction(), regex_str);
+ // This one is tricky; a temporary pointer into another temporary. Reference
+ // lifetime extension of the pointer is not sufficient.
+ EXPECT_DEATH(GlobalFunction(), ::string(regex_c_str).c_str());
+
# endif // GTEST_HAS_GLOBAL_STRING
# if !GTEST_USES_PCRE
@@ -506,6 +510,10 @@ TEST_F(TestForDeathTest, AcceptsAnythingConvertibleToRE) {
const ::std::string regex_std_str(regex_c_str);
EXPECT_DEATH(GlobalFunction(), regex_std_str);
+ // This one is tricky; a temporary pointer into another temporary. Reference
+ // lifetime extension of the pointer is not sufficient.
+ EXPECT_DEATH(GlobalFunction(), ::std::string(regex_c_str).c_str());
+
# endif // !GTEST_USES_PCRE
}