Makes gtest work with Sun Studio. Patch submitted by Hady Zalek.

This commit is contained in:
zhanyong.wan
2010-03-23 15:58:37 +00:00
parent 75e2713e45
commit e9f093ae15
4 changed files with 73 additions and 45 deletions

View File

@@ -47,10 +47,6 @@
#if GTEST_HAS_PARAM_TEST
#if GTEST_HAS_RTTI
#include <typeinfo> // NOLINT
#endif // GTEST_HAS_RTTI
namespace testing {
namespace internal {
@@ -63,24 +59,6 @@ namespace internal {
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
const char* file, int line);
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// Downcasts the pointer of type Base to Derived.
// Derived must be a subclass of Base. The parameter MUST
// point to a class of type Derived, not any subclass of it.
// When RTTI is available, the function performs a runtime
// check to enforce this.
template <class Derived, class Base>
Derived* CheckedDowncastToActualType(Base* base) {
#if GTEST_HAS_RTTI
GTEST_CHECK_(typeid(*base) == typeid(Derived));
Derived* derived = dynamic_cast<Derived*>(base); // NOLINT
#else
Derived* derived = static_cast<Derived*>(base); // Poor man's downcast.
#endif // GTEST_HAS_RTTI
return derived;
}
template <typename> class ParamGeneratorInterface;
template <typename> class ParamGenerator;