49 return strcmp(a->name(), b->name()) < 0;
59 auto const**
const test_suites =
new const TestSuite*[
static_cast<size_t>(
76 if (0 == strcmp(test_suite->
name(), name))
return test_suite;
108 TEST(ApiTest, UnitTestImmutableAccessorsWork) {
113 EXPECT_EQ(2, unit_test->disabled_test_count());
121 EXPECT_STREQ(
"TestSuiteWithCommentTest/0", test_suites[2]->name());
123 delete[] test_suites;
129 RecordProperty(
"key",
"value");
132 AssertionResult
IsNull(
const char* str) {
133 if (str !=
nullptr) {
139 TEST(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());
200 TEST(ApiTest, TestSuiteDisabledAccessorsWork) {
213 EXPECT_STREQ(
"DISABLED_Test", test_info->test_suite_name());
221 TEST(ApiTest, DISABLED_Dummy1) {}
231 EXPECT_EQ(0, unit_test->failed_test_suite_count());
232 EXPECT_EQ(0, unit_test->failed_test_count());
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;
322 int main(
int argc,
char** argv) {
Environment * AddGlobalTestEnvironment(Environment *env)
const TestInfo * GetTestInfo(int i) const
TYPED_TEST_SUITE(TestSuiteWithCommentTest, Types< int >)
AssertionResult AssertionFailure()
int total_test_count() const
TYPED_TEST(TestSuiteWithCommentTest, Dummy)
#define ASSERT_EQ(val1, val2)
const TestProperty & GetTestProperty(int i) const
const char * name() const
bool operator()(const T *a, const T *b)
const TestSuite * GetTestSuite(int i) const
std::string GetTypeName()
static TestSuite const ** GetSortedTestSuites()
#define ASSERT_TRUE(condition)
AssertionResult AssertionSuccess()
int total_test_suite_count() const
const char * type_param() const
int test_to_run_count() const
#define EXPECT_STREQ(s1, s2)
#define EXPECT_EQ(val1, val2)
static const TestSuite * FindTestSuite(const char *name)
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)
const TestResult * result() const
#define EXPECT_TRUE(condition)
static UnitTest * GetInstance()
#define EXPECT_FALSE(condition)
int disabled_test_count() const
AssertionResult IsNull(const char *str)
TEST(IsXDigitTest, WorksForNarrowAscii)