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))
108TEST(ApiTest, UnitTestImmutableAccessorsWork) {
121 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", test_suites[2]->name());
123 delete[] test_suites;
129 RecordProperty(
"key",
"value");
133 if (str !=
nullptr) {
139TEST(ApiTest, TestSuiteImmutableAccessorsWork) {
158 EXPECT_STREQ(
"TestSuiteDisabledAccessorsWork", tests[1]->name());
164 EXPECT_STREQ(
"TestSuiteImmutableAccessorsWork", tests[2]->name());
170 EXPECT_STREQ(
"UnitTestImmutableAccessorsWork", tests[3]->name());
192 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", tests[0]->test_suite_name());
200TEST(ApiTest, TestSuiteDisabledAccessorsWork) {
221TEST(ApiTest, DISABLED_Dummy1) {}
242 EXPECT_EQ(1, test_suites[0]->disabled_test_count());
243 ASSERT_EQ(4, test_suites[0]->total_test_count());
244 EXPECT_EQ(3, test_suites[0]->successful_test_count());
245 EXPECT_EQ(0, test_suites[0]->failed_test_count());
252 EXPECT_EQ(1, test_suites[1]->disabled_test_count());
253 ASSERT_EQ(1, test_suites[1]->total_test_count());
254 EXPECT_EQ(0, test_suites[1]->successful_test_count());
255 EXPECT_EQ(0, test_suites[1]->failed_test_count());
257 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", test_suites[2]->name());
259 test_suites[2]->type_param());
261 EXPECT_EQ(0, test_suites[2]->disabled_test_count());
262 ASSERT_EQ(1, test_suites[2]->total_test_count());
263 EXPECT_EQ(1, test_suites[2]->successful_test_count());
264 EXPECT_EQ(0, test_suites[2]->failed_test_count());
274 EXPECT_STREQ(
"TestSuiteDisabledAccessorsWork", tests[1]->name());
280 EXPECT_EQ(0, tests[1]->result()->test_property_count());
282 EXPECT_STREQ(
"TestSuiteImmutableAccessorsWork", tests[2]->name());
288 EXPECT_EQ(0, tests[2]->result()->test_property_count());
290 EXPECT_STREQ(
"UnitTestImmutableAccessorsWork", tests[3]->name());
296 EXPECT_EQ(1, tests[3]->result()->test_property_count());
307 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", tests[0]->test_suite_name());
312 EXPECT_EQ(0, tests[0]->result()->test_property_count());
315 delete[] test_suites;
322int main(
int argc,
char **argv) {
#define ASSERT_EQ(val1, val2)
#define EXPECT_EQ(val1, val2)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
#define EXPECT_TRUE(condition)
#define EXPECT_STREQ(s1, s2)
#define ASSERT_TRUE(condition)
#define EXPECT_FALSE(condition)
int main(int argc, char **argv)
Environment * AddGlobalTestEnvironment(Environment *env)
AssertionResult AssertionFailure()
AssertionResult AssertionSuccess()
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
TEST(IsXDigitTest, WorksForNarrowAscii)
std::string GetTypeName()
const int kTypedTestSuites
TYPED_TEST(TestSuiteWithCommentTest, Dummy)
TYPED_TEST_SUITE(TestSuiteWithCommentTest, Types< int >)
AssertionResult IsNull(const char *str)
const TestProperty & GetTestProperty(int i) const
const char * value_param() const
const char * type_param() const
const char * name() const
const TestResult * result() const
const char * test_suite_name() const
int test_to_run_count() const
const char * name() const
int total_test_count() const
const char * type_param() const
const TestInfo * GetTestInfo(int i) const
int disabled_test_count() const
int failed_test_suite_count() const
static UnitTest * GetInstance()
int test_to_run_count() const
int successful_test_count() const
const TestSuite * GetTestSuite(int i) const
int failed_test_count() const
int disabled_test_count() const
int test_suite_to_run_count() const
int successful_test_suite_count() const
int total_test_count() const
int total_test_suite_count() const
bool operator()(const T *a, const T *b)
static TestInfo const ** GetSortedTests(const TestSuite *test_suite)
static TestSuite const ** GetSortedTestSuites()
static const TestSuite * FindTestSuite(const char *name)