aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest/gtest.h
diff options
context:
space:
mode:
authorshiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-08-06 21:44:19 +0000
committershiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-08-06 21:44:19 +0000
commitd5f13d4a257b6bfc43068f3a918989cf89af75ec (patch)
treefae369ee214062805989e6506d40f297c85b22c9 /include/gtest/gtest.h
parent9b093c1779eb48a55db026cfd525f4cf1bbd4749 (diff)
downloadgoogletest-d5f13d4a257b6bfc43068f3a918989cf89af75ec.tar.gz
googletest-d5f13d4a257b6bfc43068f3a918989cf89af75ec.tar.bz2
googletest-d5f13d4a257b6bfc43068f3a918989cf89af75ec.zip
Changes test creation functions to factories. By Vlad Losev.
Diffstat (limited to 'include/gtest/gtest.h')
-rw-r--r--include/gtest/gtest.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/gtest/gtest.h b/include/gtest/gtest.h
index 2464f725..1f5d7640 100644
--- a/include/gtest/gtest.h
+++ b/include/gtest/gtest.h
@@ -310,11 +310,6 @@ class Test {
};
-// Defines the type of a function pointer that creates a Test object
-// when invoked.
-typedef Test* (*TestMaker)();
-
-
// A TestInfo object stores the following information about a test:
//
// Test case name
@@ -342,7 +337,9 @@ class TestInfo {
// fixture_class_id: ID of the test fixture class
// 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
- // maker: pointer to the function that creates a test object
+ // factory: Pointer to the factory that creates a test object.
+ // The newly created TestInfo instance will assume
+ // ownershi pof the factory object.
//
// This is public only because it's needed by the TEST and TEST_F macros.
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
@@ -352,7 +349,7 @@ class TestInfo {
internal::TypeId fixture_class_id,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc,
- TestMaker maker);
+ internal::TestFactoryBase* factory);
// Returns the test case name.
const char* test_case_name() const;
@@ -395,9 +392,11 @@ class TestInfo {
internal::TestInfoImpl* impl() { return impl_; }
const internal::TestInfoImpl* impl() const { return impl_; }
- // Constructs a TestInfo object.
+ // Constructs a TestInfo object. The newly constructed instance assumes
+ // ownership of the factory object.
TestInfo(const char* test_case_name, const char* name,
- internal::TypeId fixture_class_id, TestMaker maker);
+ internal::TypeId fixture_class_id,
+ internal::TestFactoryBase* factory);
// An opaque implementation object.
internal::TestInfoImpl* impl_;