Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::FinalSuccessChecker Class Reference
Inheritance diagram for testing::internal::FinalSuccessChecker:
Collaboration diagram for testing::internal::FinalSuccessChecker:

Protected Member Functions

virtual void TearDown ()
 

Additional Inherited Members

- Public Member Functions inherited from testing::Environment
virtual ~Environment ()
 
virtual void SetUp ()
 

Detailed Description

Definition at line 234 of file gtest-unittest-api_test.cc.

Member Function Documentation

◆ TearDown()

virtual void testing::internal::FinalSuccessChecker::TearDown ( )
inlineprotectedvirtual

Reimplemented from testing::Environment.

Definition at line 236 of file gtest-unittest-api_test.cc.

236 {
237 UnitTest* unit_test = UnitTest::GetInstance();
238
239 EXPECT_EQ(1 + kTypedTestCases, unit_test->successful_test_case_count());
240 EXPECT_EQ(3 + kTypedTests, unit_test->successful_test_count());
241 EXPECT_EQ(0, unit_test->failed_test_case_count());
242 EXPECT_EQ(0, unit_test->failed_test_count());
243 EXPECT_TRUE(unit_test->Passed());
244 EXPECT_FALSE(unit_test->Failed());
245 ASSERT_EQ(2 + kTypedTestCases, unit_test->total_test_case_count());
246
247 const TestCase** const test_cases = UnitTestHelper::GetSortedTestCases();
248
249 EXPECT_STREQ("ApiTest", test_cases[0]->name());
250 EXPECT_TRUE(IsNull(test_cases[0]->type_param()));
251 EXPECT_TRUE(test_cases[0]->should_run());
252 EXPECT_EQ(1, test_cases[0]->disabled_test_count());
253 ASSERT_EQ(4, test_cases[0]->total_test_count());
254 EXPECT_EQ(3, test_cases[0]->successful_test_count());
255 EXPECT_EQ(0, test_cases[0]->failed_test_count());
256 EXPECT_TRUE(test_cases[0]->Passed());
257 EXPECT_FALSE(test_cases[0]->Failed());
258
259 EXPECT_STREQ("DISABLED_Test", test_cases[1]->name());
260 EXPECT_TRUE(IsNull(test_cases[1]->type_param()));
261 EXPECT_FALSE(test_cases[1]->should_run());
262 EXPECT_EQ(1, test_cases[1]->disabled_test_count());
263 ASSERT_EQ(1, test_cases[1]->total_test_count());
264 EXPECT_EQ(0, test_cases[1]->successful_test_count());
265 EXPECT_EQ(0, test_cases[1]->failed_test_count());
266
267#if GTEST_HAS_TYPED_TEST
268 EXPECT_STREQ("TestCaseWithCommentTest/0", test_cases[2]->name());
269 EXPECT_STREQ(GetTypeName<int>().c_str(), test_cases[2]->type_param());
270 EXPECT_TRUE(test_cases[2]->should_run());
271 EXPECT_EQ(0, test_cases[2]->disabled_test_count());
272 ASSERT_EQ(1, test_cases[2]->total_test_count());
273 EXPECT_EQ(1, test_cases[2]->successful_test_count());
274 EXPECT_EQ(0, test_cases[2]->failed_test_count());
275 EXPECT_TRUE(test_cases[2]->Passed());
276 EXPECT_FALSE(test_cases[2]->Failed());
277#endif // GTEST_HAS_TYPED_TEST
278
279 const TestCase* test_case = UnitTestHelper::FindTestCase("ApiTest");
280 const TestInfo** tests = UnitTestHelper::GetSortedTests(test_case);
281 EXPECT_STREQ("DISABLED_Dummy1", tests[0]->name());
282 EXPECT_STREQ("ApiTest", tests[0]->test_case_name());
283 EXPECT_FALSE(tests[0]->should_run());
284
285 EXPECT_STREQ("TestCaseDisabledAccessorsWork", tests[1]->name());
286 EXPECT_STREQ("ApiTest", tests[1]->test_case_name());
287 EXPECT_TRUE(IsNull(tests[1]->value_param()));
288 EXPECT_TRUE(IsNull(tests[1]->type_param()));
289 EXPECT_TRUE(tests[1]->should_run());
290 EXPECT_TRUE(tests[1]->result()->Passed());
291 EXPECT_EQ(0, tests[1]->result()->test_property_count());
292
293 EXPECT_STREQ("TestCaseImmutableAccessorsWork", tests[2]->name());
294 EXPECT_STREQ("ApiTest", tests[2]->test_case_name());
295 EXPECT_TRUE(IsNull(tests[2]->value_param()));
296 EXPECT_TRUE(IsNull(tests[2]->type_param()));
297 EXPECT_TRUE(tests[2]->should_run());
298 EXPECT_TRUE(tests[2]->result()->Passed());
299 EXPECT_EQ(0, tests[2]->result()->test_property_count());
300
301 EXPECT_STREQ("UnitTestImmutableAccessorsWork", tests[3]->name());
302 EXPECT_STREQ("ApiTest", tests[3]->test_case_name());
303 EXPECT_TRUE(IsNull(tests[3]->value_param()));
304 EXPECT_TRUE(IsNull(tests[3]->type_param()));
305 EXPECT_TRUE(tests[3]->should_run());
306 EXPECT_TRUE(tests[3]->result()->Passed());
307 EXPECT_EQ(1, tests[3]->result()->test_property_count());
308 const TestProperty& property = tests[3]->result()->GetTestProperty(0);
309 EXPECT_STREQ("key", property.key());
310 EXPECT_STREQ("value", property.value());
311
312 delete[] tests;
313
314#if GTEST_HAS_TYPED_TEST
315 test_case = UnitTestHelper::FindTestCase("TestCaseWithCommentTest/0");
316 tests = UnitTestHelper::GetSortedTests(test_case);
317
318 EXPECT_STREQ("Dummy", tests[0]->name());
319 EXPECT_STREQ("TestCaseWithCommentTest/0", tests[0]->test_case_name());
320 EXPECT_TRUE(IsNull(tests[0]->value_param()));
321 EXPECT_STREQ(GetTypeName<int>().c_str(), tests[0]->type_param());
322 EXPECT_TRUE(tests[0]->should_run());
323 EXPECT_TRUE(tests[0]->result()->Passed());
324 EXPECT_EQ(0, tests[0]->result()->test_property_count());
325
326 delete[] tests;
327#endif // GTEST_HAS_TYPED_TEST
328 delete[] test_cases;
329 }
std::string name
static UnitTest * GetInstance()
Definition gtest.cc:4374
static TestInfo const ** GetSortedTests(const TestCase *test_case)
static const TestCase * FindTestCase(const char *name)
static TestCase const ** GetSortedTestCases()
#define ASSERT_EQ(val1, val2)
Definition gtest.h:1988
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1954
#define EXPECT_TRUE(condition)
Definition gtest.h:1895
#define EXPECT_STREQ(s1, s2)
Definition gtest.h:2027
#define EXPECT_FALSE(condition)
Definition gtest.h:1898
std::string GetTypeName()
PolymorphicMatcher< internal::IsNullMatcher > IsNull()
Here is the call graph for this function:

The documentation for this class was generated from the following file: