diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:19:57 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:19:57 +0000 |
commit | 9112829d76cbb8e0c8ef51bbc2d7d1be48cd7b74 (patch) | |
tree | 9de1c5f67a98cd0e73c60838396486c984f63ac2 /utils/unittest/googletest/include/gtest/internal/gtest-param-util.h | |
parent | 1e3dec662ea18131c495db50caccc57f77b7a5fe (diff) | |
download | FreeBSD-src-9112829d76cbb8e0c8ef51bbc2d7d1be48cd7b74.zip FreeBSD-src-9112829d76cbb8e0c8ef51bbc2d7d1be48cd7b74.tar.gz |
Update LLVM to r108243.
Diffstat (limited to 'utils/unittest/googletest/include/gtest/internal/gtest-param-util.h')
-rw-r--r-- | utils/unittest/googletest/include/gtest/internal/gtest-param-util.h | 68 |
1 files changed, 29 insertions, 39 deletions
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 <utility> #include <vector> +// 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 <gtest/internal/gtest-internal.h> +#include <gtest/internal/gtest-linked_ptr.h> #include <gtest/internal/gtest-port.h> -#ifdef GTEST_HAS_PARAM_TEST - -#if GTEST_HAS_RTTI -#include <typeinfo> -#endif // GTEST_HAS_RTTI - -#include <gtest/internal/gtest-linked_ptr.h> -#include <gtest/internal/gtest-internal.h> +#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 <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; -} +GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, + const char* file, int line); template <typename> class ParamGeneratorInterface; template <typename> class ParamGenerator; @@ -169,7 +149,7 @@ class ParamGeneratorInterface { virtual ParamIteratorInterface<T>* End() const = 0; }; -// Wraps ParamGeneratorInetrface<T> and provides general generator syntax +// Wraps ParamGeneratorInterface<T> and provides general generator syntax // compatible with the STL Container concept. // This class implements copy initialization semantics and the contained // ParamGeneratorInterface<T> instance is shared among all copies @@ -245,9 +225,13 @@ class RangeGenerator : public ParamGeneratorInterface<T> { private: Iterator(const Iterator& other) - : base_(other.base_), value_(other.value_), index_(other.index_), + : ParamIteratorInterface<T>(), + base_(other.base_), value_(other.value_), index_(other.index_), step_(other.step_) {} + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + const ParamGeneratorInterface<T>* const base_; T value_; int index_; @@ -263,6 +247,9 @@ class RangeGenerator : public ParamGeneratorInterface<T> { 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<T> { // Use of scoped_ptr helps manage cached value's lifetime, // which is bound by the lifespan of the iterator itself. mutable scoped_ptr<const T> 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<ParamType>* 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<ParamType>* 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; |