diff options
author | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-09-08 17:55:52 (GMT) |
---|---|---|
committer | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-09-08 17:55:52 (GMT) |
commit | a2b1a8556ea64014606d78b09333d9c522430a25 (patch) | |
tree | a4f4a88d89b4f957655a479bba3f33908572fcb5 /src/gtest-internal-inl.h | |
parent | 0c5a66245b8c5939b36b2aad6f4d5ab89b724b1a (diff) | |
download | googletest-a2b1a8556ea64014606d78b09333d9c522430a25.zip googletest-a2b1a8556ea64014606d78b09333d9c522430a25.tar.gz googletest-a2b1a8556ea64014606d78b09333d9c522430a25.tar.bz2 |
Adds support for type-parameterized tests (by Zhanyong Wan); also adds case-insensitive wide string comparison to the String class (by Vlad Losev).
Diffstat (limited to 'src/gtest-internal-inl.h')
-rw-r--r-- | src/gtest-internal-inl.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h index 2633d69..6aafc7b 100644 --- a/src/gtest-internal-inl.h +++ b/src/gtest-internal-inl.h @@ -563,7 +563,8 @@ class TestResult { class TestInfoImpl { public: TestInfoImpl(TestInfo* parent, const char* test_case_name, - const char* name, TypeId fixture_class_id, + const char* name, const char* test_case_comment, + const char* comment, TypeId fixture_class_id, internal::TestFactoryBase* factory); ~TestInfoImpl(); @@ -585,6 +586,12 @@ class TestInfoImpl { // Returns the test name. const char* name() const { return name_.c_str(); } + // Returns the test case comment. + const char* test_case_comment() const { return test_case_comment_.c_str(); } + + // Returns the test comment. + const char* comment() const { return comment_.c_str(); } + // Returns the ID of the test fixture class. TypeId fixture_class_id() const { return fixture_class_id_; } @@ -611,12 +618,14 @@ class TestInfoImpl { private: // These fields are immutable properties of the test. - TestInfo* const parent_; // The owner of this object - const String test_case_name_; // Test case name - const String name_; // Test name - const TypeId fixture_class_id_; // ID of the test fixture class - bool should_run_; // True iff this test should run - bool is_disabled_; // True iff this test is disabled + TestInfo* const parent_; // The owner of this object + const String test_case_name_; // Test case name + const String name_; // Test name + const String test_case_comment_; // Test case comment + const String comment_; // Test comment + const TypeId fixture_class_id_; // ID of the test fixture class + bool should_run_; // True iff this test should run + bool is_disabled_; // True iff this test is disabled internal::TestFactoryBase* const factory_; // The factory that creates // the test object @@ -644,7 +653,7 @@ class TestCase { // name: name of the test case // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case - TestCase(const char* name, + TestCase(const char* name, const char* comment, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); @@ -654,6 +663,9 @@ class TestCase { // Gets the name of the TestCase. const char* name() const { return name_.c_str(); } + // Returns the test case comment. + const char* comment() const { return comment_.c_str(); } + // Returns true if any test in this test case should run. bool should_run() const { return should_run_; } @@ -739,6 +751,8 @@ class TestCase { private: // Name of the test case. internal::String name_; + // Comment on the test case. + internal::String comment_; // List of TestInfos. internal::List<TestInfo*>* test_info_list_; // Pointer to the function that sets up the test case. @@ -799,7 +813,7 @@ class UnitTestOptions { // This function is useful as an __except condition. static int GTestShouldProcessSEH(DWORD exception_code); #endif // GTEST_OS_WINDOWS - private: + // Returns true if "name" matches the ':' separated list of glob-style // filters in "filter". static bool MatchesFilter(const String& name, const char* filter); @@ -975,6 +989,7 @@ class UnitTestImpl : public TestPartResultReporterInterface { // set_up_tc: pointer to the function that sets up the test case // tear_down_tc: pointer to the function that tears down the test case TestCase* GetTestCase(const char* test_case_name, + const char* comment, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc); @@ -989,6 +1004,7 @@ class UnitTestImpl : public TestPartResultReporterInterface { Test::TearDownTestCaseFunc tear_down_tc, TestInfo * test_info) { GetTestCase(test_info->test_case_name(), + test_info->test_case_comment(), set_up_tc, tear_down_tc)->AddTestInfo(test_info); } |