From 9112829d76cbb8e0c8ef51bbc2d7d1be48cd7b74 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Tue, 13 Jul 2010 17:19:57 +0000 Subject: Update LLVM to r108243. --- .../include/gtest/internal/gtest-param-util.h | 68 +++++++++------------- 1 file changed, 29 insertions(+), 39 deletions(-) (limited to 'utils/unittest/googletest/include/gtest/internal/gtest-param-util.h') diff --git a/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h b/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h index 3bb07ec..0cbb58c 100644 --- a/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h +++ b/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h @@ -38,16 +38,14 @@ #include #include +// scripts/fuse_gtest.py depends on gtest's own header being #included +// *unconditionally*. Therefore these #includes cannot be moved +// inside #if GTEST_HAS_PARAM_TEST. +#include +#include #include -#ifdef GTEST_HAS_PARAM_TEST - -#if GTEST_HAS_RTTI -#include -#endif // GTEST_HAS_RTTI - -#include -#include +#if GTEST_HAS_PARAM_TEST namespace testing { namespace internal { @@ -58,26 +56,8 @@ namespace internal { // fixture class for the same test case. This may happen when // TEST_P macro is used to define two tests with the same name // but in different namespaces. -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 -Derived* CheckedDowncastToActualType(Base* base) { -#if GTEST_HAS_RTTI - GTEST_CHECK_(typeid(*base) == typeid(Derived)); - Derived* derived = dynamic_cast(base); // NOLINT -#else - Derived* derived = static_cast(base); // Poor man's downcast. -#endif // GTEST_HAS_RTTI - return derived; -} +GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, + const char* file, int line); template class ParamGeneratorInterface; template class ParamGenerator; @@ -169,7 +149,7 @@ class ParamGeneratorInterface { virtual ParamIteratorInterface* End() const = 0; }; -// Wraps ParamGeneratorInetrface and provides general generator syntax +// Wraps ParamGeneratorInterface and provides general generator syntax // compatible with the STL Container concept. // This class implements copy initialization semantics and the contained // ParamGeneratorInterface instance is shared among all copies @@ -245,9 +225,13 @@ class RangeGenerator : public ParamGeneratorInterface { private: Iterator(const Iterator& other) - : base_(other.base_), value_(other.value_), index_(other.index_), + : ParamIteratorInterface(), + base_(other.base_), value_(other.value_), index_(other.index_), step_(other.step_) {} + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + const ParamGeneratorInterface* const base_; T value_; int index_; @@ -263,6 +247,9 @@ class RangeGenerator : public ParamGeneratorInterface { return end_index; } + // No implementation - assignment is unsupported. + void operator=(const RangeGenerator& other); + const T begin_; const T end_; const IncrementT step_; @@ -349,7 +336,10 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface { // Use of scoped_ptr helps manage cached value's lifetime, // which is bound by the lifespan of the iterator itself. mutable scoped_ptr value_; - }; + }; // class ValuesInIteratorRangeGenerator::Iterator + + // No implementation - assignment is unsupported. + void operator=(const ValuesInIteratorRangeGenerator& other); const ContainerType container_; }; // class ValuesInIteratorRangeGenerator @@ -483,8 +473,8 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { // about a generator. int AddTestCaseInstantiation(const char* instantiation_name, GeneratorCreationFunc* func, - const char* file, - int line) { + const char* /* file */, + int /* line */) { instantiations_.push_back(::std::make_pair(instantiation_name, func)); return 0; // Return value used only to run this method in namespace scope. } @@ -533,12 +523,12 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { // LocalTestInfo structure keeps information about a single test registered // with TEST_P macro. struct TestInfo { - TestInfo(const char* test_case_base_name, - const char* test_base_name, - TestMetaFactoryBase* test_meta_factory) : - test_case_base_name(test_case_base_name), - test_base_name(test_base_name), - test_meta_factory(test_meta_factory) {} + TestInfo(const char* a_test_case_base_name, + const char* a_test_base_name, + TestMetaFactoryBase* a_test_meta_factory) : + test_case_base_name(a_test_case_base_name), + test_base_name(a_test_base_name), + test_meta_factory(a_test_meta_factory) {} const String test_case_base_name; const String test_base_name; -- cgit v1.1