44 using ::testing::TestEventListeners;
45 using ::testing::TestWithParam;
46 using ::testing::UnitTest;
47 using ::testing::Test;
48 using ::testing::Values;
54 SUCCEED() <<
"This is a success.";
69 FAIL() <<
"Unexpected failure: Disabled test should not be run";
72 TEST(MixedResultTest, Succeeds) {
77 TEST(MixedResultTest, Fails) {
82 TEST(MixedResultTest, DISABLED_test) {
83 FAIL() <<
"Unexpected failure: Disabled test should not be run";
86 TEST(XmlQuotingTest, OutputsCData) {
87 FAIL() <<
"XML output: "
88 "<?xml encoding=\"utf-8\"><top><![CDATA[cdata text]]></top>";
93 TEST(InvalidCharactersTest, InvalidCharactersInMessage) {
94 FAIL() <<
"Invalid characters in brackets [\x1\x2]";
104 RecordProperty(
"key_1",
"1");
108 RecordProperty(
"key_int", 1);
112 RecordProperty(
"key_1",
"1");
113 RecordProperty(
"key_2",
"2");
114 RecordProperty(
"key_3",
"3");
118 RecordProperty(
"key_1",
"1");
119 RecordProperty(
"key_1",
"2");
122 TEST(NoFixtureTest, RecordProperty) {
123 RecordProperty(
"key",
"1");
135 TEST(NoFixtureTest, ExternalUtilityThatCallsRecordIntValuedProperty) {
139 TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty) {
150 #if GTEST_HAS_TYPED_TEST
154 typedef testing::Types<int, long> TypedTestTypes;
159 #if GTEST_HAS_TYPED_TEST_P
162 template <
typename T>
class TypeParameterizedTestCase :
public Test {};
164 TYPED_TEST_P(TypeParameterizedTestCase, HasTypeParamAttribute) {}
166 typedef testing::Types<int, long> TypeParameterizedTestCaseTypes;
168 TypeParameterizedTestCase,
169 TypeParameterizedTestCaseTypes);
172 int main(
int argc,
char** argv) {
175 if (argc > 1 && strcmp(argv[1],
"--shut_down_xml") == 0) {
176 TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
177 delete listeners.Release(listeners.default_xml_generator());