48 return strcmp(a->name(), b->name()) < 0;
58 auto const**
const test_suites =
new const TestSuite*[
static_cast<size_t>(
64 std::sort(test_suites,
76 if (0 == strcmp(test_suite->
name(), name))
98 #if GTEST_HAS_TYPED_TEST
99 template <
typename T>
class TestSuiteWithCommentTest :
public Test {};
108 #endif // GTEST_HAS_TYPED_TEST
113 TEST(ApiTest, UnitTestImmutableAccessorsWork) {
126 #if GTEST_HAS_TYPED_TEST
127 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", test_suites[2]->name());
128 #endif // GTEST_HAS_TYPED_TEST
130 delete[] test_suites;
136 RecordProperty(
"key",
"value");
139 AssertionResult
IsNull(
const char* str) {
140 if (str !=
nullptr) {
146 TEST(ApiTest, TestSuiteImmutableAccessorsWork) {
165 EXPECT_STREQ(
"TestSuiteDisabledAccessorsWork", tests[1]->name());
171 EXPECT_STREQ(
"TestSuiteImmutableAccessorsWork", tests[2]->name());
177 EXPECT_STREQ(
"UnitTestImmutableAccessorsWork", tests[3]->name());
186 #if GTEST_HAS_TYPED_TEST
200 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", tests[0]->test_suite_name());
206 #endif // GTEST_HAS_TYPED_TEST
209 TEST(ApiTest, TestSuiteDisabledAccessorsWork) {
222 EXPECT_STREQ(
"DISABLED_Test", test_info->test_suite_name());
230 TEST(ApiTest, DISABLED_Dummy1) {}
251 EXPECT_EQ(1, test_suites[0]->disabled_test_count());
252 ASSERT_EQ(4, test_suites[0]->total_test_count());
253 EXPECT_EQ(3, test_suites[0]->successful_test_count());
254 EXPECT_EQ(0, test_suites[0]->failed_test_count());
261 EXPECT_EQ(1, test_suites[1]->disabled_test_count());
262 ASSERT_EQ(1, test_suites[1]->total_test_count());
263 EXPECT_EQ(0, test_suites[1]->successful_test_count());
264 EXPECT_EQ(0, test_suites[1]->failed_test_count());
266 #if GTEST_HAS_TYPED_TEST
267 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", test_suites[2]->name());
269 test_suites[2]->type_param());
271 EXPECT_EQ(0, test_suites[2]->disabled_test_count());
272 ASSERT_EQ(1, test_suites[2]->total_test_count());
273 EXPECT_EQ(1, test_suites[2]->successful_test_count());
274 EXPECT_EQ(0, test_suites[2]->failed_test_count());
277 #endif // GTEST_HAS_TYPED_TEST
285 EXPECT_STREQ(
"TestSuiteDisabledAccessorsWork", tests[1]->name());
291 EXPECT_EQ(0, tests[1]->result()->test_property_count());
293 EXPECT_STREQ(
"TestSuiteImmutableAccessorsWork", tests[2]->name());
299 EXPECT_EQ(0, tests[2]->result()->test_property_count());
301 EXPECT_STREQ(
"UnitTestImmutableAccessorsWork", tests[3]->name());
307 EXPECT_EQ(1, tests[3]->result()->test_property_count());
314 #if GTEST_HAS_TYPED_TEST
319 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", tests[0]->test_suite_name());
324 EXPECT_EQ(0, tests[0]->result()->test_property_count());
327 #endif // GTEST_HAS_TYPED_TEST
328 delete[] test_suites;
335 int main(
int argc,
char **argv) {
int failed_test_count() const
TYPED_TEST(CodeLocationForTYPEDTEST, Verify)
Environment * AddGlobalTestEnvironment(Environment *env)
const TestInfo * GetTestInfo(int i) const
AssertionResult AssertionFailure()
int total_test_count() const
#define ASSERT_EQ(val1, val2)
const TestProperty & GetTestProperty(int i) const
const char * name() const
bool operator()(const T *a, const T *b)
internal::ProxyTypeList< Ts...> Types
const TestSuite * GetTestSuite(int i) const
std::string GetTypeName()
int successful_test_suite_count() const
static TestSuite const ** GetSortedTestSuites()
int test_to_run_count() const
#define ASSERT_TRUE(condition)
AssertionResult AssertionSuccess()
int successful_test_count() const
int total_test_suite_count() const
const char * type_param() const
int test_to_run_count() const
#define EXPECT_STREQ(s1, s2)
int disabled_test_count() const
#define EXPECT_EQ(val1, val2)
static const TestSuite * FindTestSuite(const char *name)
int total_test_count() const
const int kTypedTestSuites
static TestInfo const ** GetSortedTests(const TestSuite *test_suite)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
TYPED_TEST_SUITE(CodeLocationForTYPEDTEST, int)
const TestResult * result() const
#define EXPECT_TRUE(condition)
static UnitTest * GetInstance()
int failed_test_suite_count() const
#define EXPECT_FALSE(condition)
int disabled_test_count() const
int test_suite_to_run_count() const
AssertionResult IsNull(const char *str)
TEST(IsXDigitTest, WorksForNarrowAscii)