Googletest export
Fix: remove two added testcases that depend on gmock; I'll put them back later in a way that doesn't break the build. PiperOrigin-RevId: 223227562
This commit is contained in:
		@@ -32,7 +32,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "gtest/gtest-death-test.h"
 | 
					#include "gtest/gtest-death-test.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gmock/gmock.h"
 | 
					 | 
				
			||||||
#include "gtest/gtest.h"
 | 
					#include "gtest/gtest.h"
 | 
				
			||||||
#include "gtest/internal/gtest-filepath.h"
 | 
					#include "gtest/internal/gtest-filepath.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -61,7 +60,7 @@ using testing::internal::AlwaysTrue;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace posix = ::testing::internal::posix;
 | 
					namespace posix = ::testing::internal::posix;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using testing::HasSubstr;
 | 
					using testing::ContainsRegex;
 | 
				
			||||||
using testing::Matcher;
 | 
					using testing::Matcher;
 | 
				
			||||||
using testing::Message;
 | 
					using testing::Message;
 | 
				
			||||||
using testing::internal::DeathTest;
 | 
					using testing::internal::DeathTest;
 | 
				
			||||||
@@ -303,14 +302,14 @@ TEST_F(TestForDeathTest, SingleStatement) {
 | 
				
			|||||||
    EXPECT_DEATH(_exit(1), "") << 1 << 2 << 3;
 | 
					    EXPECT_DEATH(_exit(1), "") << 1 << 2 << 3;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# if GTEST_USES_PCRE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DieWithEmbeddedNul() {
 | 
					void DieWithEmbeddedNul() {
 | 
				
			||||||
  fprintf(stderr, "Hello%cmy null world.\n", '\0');
 | 
					  fprintf(stderr, "Hello%cmy null world.\n", '\0');
 | 
				
			||||||
  fflush(stderr);
 | 
					  fflush(stderr);
 | 
				
			||||||
  _exit(1);
 | 
					  _exit(1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# if GTEST_USES_PCRE
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Tests that EXPECT_DEATH and ASSERT_DEATH work when the error
 | 
					// Tests that EXPECT_DEATH and ASSERT_DEATH work when the error
 | 
				
			||||||
// message has a NUL character in it.
 | 
					// message has a NUL character in it.
 | 
				
			||||||
TEST_F(TestForDeathTest, EmbeddedNulInMessage) {
 | 
					TEST_F(TestForDeathTest, EmbeddedNulInMessage) {
 | 
				
			||||||
@@ -1340,38 +1339,27 @@ TEST(MatcherDeathTest, DoesNotBreakBareRegexMatching) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
TEST(MatcherDeathTest, MonomorphicMatcherMatches) {
 | 
					TEST(MatcherDeathTest, MonomorphicMatcherMatches) {
 | 
				
			||||||
  EXPECT_DEATH(DieWithMessage("Behind O, I am slain!"),
 | 
					  EXPECT_DEATH(DieWithMessage("Behind O, I am slain!"),
 | 
				
			||||||
               Matcher<const std::string&>(HasSubstr("I am slain")));
 | 
					               Matcher<const std::string&>(ContainsRegex("I am slain")));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(MatcherDeathTest, MonomorphicMatcherDoesNotMatch) {
 | 
					TEST(MatcherDeathTest, MonomorphicMatcherDoesNotMatch) {
 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE(
 | 
					  EXPECT_NONFATAL_FAILURE(
 | 
				
			||||||
      EXPECT_DEATH(DieWithMessage("Behind O, I am slain!"),
 | 
					      EXPECT_DEATH(
 | 
				
			||||||
                   Matcher<const std::string&>(HasSubstr("Ow, I am slain"))),
 | 
					          DieWithMessage("Behind O, I am slain!"),
 | 
				
			||||||
      "Expected: has substring \"Ow, I am slain\"");
 | 
					          Matcher<const std::string&>(ContainsRegex("Ow, I am slain"))),
 | 
				
			||||||
 | 
					      "Expected: contains regular expression \"Ow, I am slain\"");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(MatcherDeathTest, PolymorphicMatcherMatches) {
 | 
					TEST(MatcherDeathTest, PolymorphicMatcherMatches) {
 | 
				
			||||||
  EXPECT_DEATH(DieWithMessage("The rest is silence."),
 | 
					  EXPECT_DEATH(DieWithMessage("The rest is silence."),
 | 
				
			||||||
               HasSubstr("rest is silence"));
 | 
					               ContainsRegex("rest is silence"));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(MatcherDeathTest, PolymorphicMatcherDoesNotMatch) {
 | 
					TEST(MatcherDeathTest, PolymorphicMatcherDoesNotMatch) {
 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(DieWithMessage("The rest is silence."),
 | 
					 | 
				
			||||||
                                       HasSubstr("rest is science")),
 | 
					 | 
				
			||||||
                          "Expected: has substring \"rest is science\"");
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST(MatcherDeathTest, CompositeMatcherMatches) {
 | 
					 | 
				
			||||||
  EXPECT_DEATH(DieWithMessage("Et tu, Brute!  Then fall, Caesar."),
 | 
					 | 
				
			||||||
               AllOf(HasSubstr("Et tu"), HasSubstr("fall, Caesar")));
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST(MatcherDeathTest, CompositeMatcherDoesNotMatch) {
 | 
					 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE(
 | 
					  EXPECT_NONFATAL_FAILURE(
 | 
				
			||||||
      EXPECT_DEATH(DieWithMessage("The rest is silence."),
 | 
					      EXPECT_DEATH(DieWithMessage("The rest is silence."),
 | 
				
			||||||
                   AnyOf(HasSubstr("Eat two"), HasSubstr("lol Caesar"))),
 | 
					                   ContainsRegex("rest is science")),
 | 
				
			||||||
      "Expected: (has substring \"Eat two\") or "
 | 
					      "Expected: contains regular expression \"rest is science\"");
 | 
				
			||||||
      "(has substring \"lol Caesar\")");
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}  // namespace
 | 
					}  // namespace
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user