aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest/gtest.h
diff options
context:
space:
mode:
authorshiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-11-24 20:13:22 +0000
committershiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-11-24 20:13:22 +0000
commitc440a6923aa65d5be64134a6f430a5867a63df3f (patch)
tree6d5be5dd4644d4c83cc5e434de31a8a4a59a3865 /include/gtest/gtest.h
parent514265c415e072caf92fb4eed57aacdfea9964f1 (diff)
downloadgoogletest-c440a6923aa65d5be64134a6f430a5867a63df3f.tar.gz
googletest-c440a6923aa65d5be64134a6f430a5867a63df3f.tar.bz2
googletest-c440a6923aa65d5be64134a6f430a5867a63df3f.zip
Enables the Python tests to run with 2.3 (necessary for testing on Mac OS X Tiger); also fixes gtest_output_test when built with xcode.
Diffstat (limited to 'include/gtest/gtest.h')
-rw-r--r--include/gtest/gtest.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/gtest/gtest.h b/include/gtest/gtest.h
index dae26473..38fcd7d8 100644
--- a/include/gtest/gtest.h
+++ b/include/gtest/gtest.h
@@ -1259,8 +1259,18 @@ AssertionResult DoubleLE(const char* expr1, const char* expr2,
// EXPECT_TRUE(foo.StatusIsOK());
// }
+// Note that we call GetTestTypeId() instead of GetTypeId<
+// ::testing::Test>() here to get the type ID of testing::Test. This
+// is to work around a suspected linker bug when using Google Test as
+// a framework on Mac OS X. The bug causes GetTypeId<
+// ::testing::Test>() to return different values depending on whether
+// the call is from the Google Test framework itself or from user test
+// code. GetTestTypeId() is guaranteed to always return the same
+// value, as it always calls GetTypeId<>() from the Google Test
+// framework.
#define TEST(test_case_name, test_name)\
- GTEST_TEST_(test_case_name, test_name, ::testing::Test)
+ GTEST_TEST_(test_case_name, test_name,\
+ ::testing::Test, ::testing::internal::GetTestTypeId())
// Defines a test that uses a test fixture.
@@ -1290,7 +1300,8 @@ AssertionResult DoubleLE(const char* expr1, const char* expr2,
// }
#define TEST_F(test_fixture, test_name)\
- GTEST_TEST_(test_fixture, test_name, test_fixture)
+ GTEST_TEST_(test_fixture, test_name, test_fixture,\
+ ::testing::internal::GetTypeId<test_fixture>())
// Use this macro in main() to run all tests. It returns 0 if all
// tests are successful, or 1 otherwise.