36 #include "gtest/gtest.h" 49 return strcmp(a->name(), b->name()) < 0;
77 if (0 == strcmp(test_case->
name(),
name))
99 #if GTEST_HAS_TYPED_TEST 100 template <
typename T>
class TestCaseWithCommentTest :
public Test {};
107 const int kTypedTestCases = 0;
108 const int kTypedTests = 0;
109 #endif // GTEST_HAS_TYPED_TEST 114 TEST(ApiTest, UnitTestImmutableAccessorsWork) {
127 #if GTEST_HAS_TYPED_TEST 129 #endif // GTEST_HAS_TYPED_TEST 137 RecordProperty(
"key",
"value");
147 TEST(ApiTest, TestCaseImmutableAccessorsWork) {
187 #if GTEST_HAS_TYPED_TEST 201 EXPECT_STREQ(
"TestCaseWithCommentTest/0", tests[0]->test_case_name());
203 EXPECT_STREQ(GetTypeName<int>().c_str(), tests[0]->type_param());
207 #endif // GTEST_HAS_TYPED_TEST 210 TEST(ApiTest, TestCaseDisabledAccessorsWork) {
223 EXPECT_STREQ(
"DISABLED_Test", test_info->test_case_name());
231 TEST(ApiTest, DISABLED_Dummy1) {}
232 TEST(DISABLED_Test, Dummy2) {}
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());
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());
267 #if GTEST_HAS_TYPED_TEST 269 EXPECT_STREQ(GetTypeName<int>().c_str(), test_cases[2]->type_param());
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());
277 #endif // GTEST_HAS_TYPED_TEST 291 EXPECT_EQ(0, tests[1]->result()->test_property_count());
299 EXPECT_EQ(0, tests[2]->result()->test_property_count());
307 EXPECT_EQ(1, tests[3]->result()->test_property_count());
314 #if GTEST_HAS_TYPED_TEST 319 EXPECT_STREQ(
"TestCaseWithCommentTest/0", tests[0]->test_case_name());
321 EXPECT_STREQ(GetTypeName<int>().c_str(), tests[0]->type_param());
324 EXPECT_EQ(0, tests[0]->result()->test_property_count());
327 #endif // GTEST_HAS_TYPED_TEST int main(int argc, char **argv)
int failed_test_count() const
const char * type_param() const
TYPED_TEST(CodeLocationForTYPEDTEST, Verify)
TYPED_TEST_CASE(CodeLocationForTYPEDTEST, int)
GTEST_API_ AssertionResult AssertionFailure()
const TestInfo * GetTestInfo(int i) const
#define ASSERT_EQ(val1, val2)
Environment * AddGlobalTestEnvironment(Environment *env)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
#define EXPECT_EQ(val1, val2)
const TestProperty & GetTestProperty(int i) const
bool operator()(const T *a, const T *b)
int disabled_test_count() const
int total_test_count() const
static const TestCase * FindTestCase(const char *name)
static TestInfo const ** GetSortedTests(const TestCase *test_case)
#define EXPECT_STREQ(s1, s2)
int test_case_to_run_count() const
int test_to_run_count() const
GTEST_API_ AssertionResult AssertionSuccess()
int successful_test_count() const
int test_to_run_count() const
int total_test_case_count() const
const int kTypedTestCases
const TestCase * GetTestCase(int i) const
#define EXPECT_TRUE(condition)
int disabled_test_count() const
int total_test_count() const
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
int failed_test_case_count() const
const char * name() const
int successful_test_case_count() const
const TestResult * result() const
static UnitTest * GetInstance()
#define EXPECT_FALSE(condition)
static TestCase const ** GetSortedTestCases()
#define ASSERT_TRUE(condition)
AssertionResult IsNull(const char *str)
TEST(IsXDigitTest, WorksForNarrowAscii)