Googletest export
Remove the #ifs for old, unsupported and buggy compilers: * old versions of GCC & MSVC * Symbian PiperOrigin-RevId: 227116941
This commit is contained in:
		
							parent
							
								
									fa932da32c
								
							
						
					
					
						commit
						cb1ea717e7
					
				@ -1140,10 +1140,6 @@ SetArgPointee(const T& x) {
 | 
				
			|||||||
      N, T, internal::IsAProtocolMessage<T>::value>(x));
 | 
					      N, T, internal::IsAProtocolMessage<T>::value>(x));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
 | 
					 | 
				
			||||||
// This overload allows SetArgPointee() to accept a string literal.
 | 
					 | 
				
			||||||
// GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish
 | 
					 | 
				
			||||||
// this overload from the templated version and emit a compile error.
 | 
					 | 
				
			||||||
template <size_t N>
 | 
					template <size_t N>
 | 
				
			||||||
PolymorphicAction<
 | 
					PolymorphicAction<
 | 
				
			||||||
  internal::SetArgumentPointeeAction<N, const char*, false> >
 | 
					  internal::SetArgumentPointeeAction<N, const char*, false> >
 | 
				
			||||||
@ -1159,7 +1155,6 @@ SetArgPointee(const wchar_t* p) {
 | 
				
			|||||||
  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
 | 
					  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
 | 
				
			||||||
      N, const wchar_t*, false>(p));
 | 
					      N, const wchar_t*, false>(p));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// The following version is DEPRECATED.
 | 
					// The following version is DEPRECATED.
 | 
				
			||||||
template <size_t N, typename T>
 | 
					template <size_t N, typename T>
 | 
				
			||||||
 | 
				
			|||||||
@ -244,11 +244,8 @@ inline Matcher<T> MatcherCast(const M& matcher) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Implements SafeMatcherCast().
 | 
					// Implements SafeMatcherCast().
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// We use an intermediate class to do the actual safe casting as Nokia's
 | 
					// FIXME: The intermediate SafeMatcherCastImpl class was introduced as a
 | 
				
			||||||
// Symbian compiler cannot decide between
 | 
					// workaround for a compiler bug, and can now be removed.
 | 
				
			||||||
// template <T, M> ... (M) and
 | 
					 | 
				
			||||||
// template <T, U> ... (const Matcher<U>&)
 | 
					 | 
				
			||||||
// for function templates but can for member function templates.
 | 
					 | 
				
			||||||
template <typename T>
 | 
					template <typename T>
 | 
				
			||||||
class SafeMatcherCastImpl {
 | 
					class SafeMatcherCastImpl {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
@ -1714,23 +1711,22 @@ class FieldMatcher {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  template <typename T>
 | 
					  template <typename T>
 | 
				
			||||||
  bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
 | 
					  bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
 | 
				
			||||||
 | 
					    // FIXME: The dispatch on std::is_pointer was introduced as a workaround for
 | 
				
			||||||
 | 
					    // a compiler bug, and can now be removed.
 | 
				
			||||||
    return MatchAndExplainImpl(
 | 
					    return MatchAndExplainImpl(
 | 
				
			||||||
        typename ::testing::internal::
 | 
					        typename std::is_pointer<GTEST_REMOVE_CONST_(T)>::type(), value,
 | 
				
			||||||
            is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
 | 
					        listener);
 | 
				
			||||||
        value, listener);
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
  // The first argument of MatchAndExplainImpl() is needed to help
 | 
					  bool MatchAndExplainImpl(std::false_type /* is_not_pointer */,
 | 
				
			||||||
  // Symbian's C++ compiler choose which overload to use.  Its type is
 | 
					                           const Class& obj,
 | 
				
			||||||
  // true_type iff the Field() matcher is used to match a pointer.
 | 
					 | 
				
			||||||
  bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,
 | 
					 | 
				
			||||||
                           MatchResultListener* listener) const {
 | 
					                           MatchResultListener* listener) const {
 | 
				
			||||||
    *listener << whose_field_ << "is ";
 | 
					    *listener << whose_field_ << "is ";
 | 
				
			||||||
    return MatchPrintAndExplain(obj.*field_, matcher_, listener);
 | 
					    return MatchPrintAndExplain(obj.*field_, matcher_, listener);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
 | 
					  bool MatchAndExplainImpl(std::true_type /* is_pointer */, const Class* p,
 | 
				
			||||||
                           MatchResultListener* listener) const {
 | 
					                           MatchResultListener* listener) const {
 | 
				
			||||||
    if (p == nullptr) return false;
 | 
					    if (p == nullptr) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1738,7 +1734,7 @@ class FieldMatcher {
 | 
				
			|||||||
    // Since *p has a field, it must be a class/struct/union type and
 | 
					    // Since *p has a field, it must be a class/struct/union type and
 | 
				
			||||||
    // thus cannot be a pointer.  Therefore we pass false_type() as
 | 
					    // thus cannot be a pointer.  Therefore we pass false_type() as
 | 
				
			||||||
    // the first argument.
 | 
					    // the first argument.
 | 
				
			||||||
    return MatchAndExplainImpl(false_type(), *p, listener);
 | 
					    return MatchAndExplainImpl(std::false_type(), *p, listener);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const FieldType Class::*field_;
 | 
					  const FieldType Class::*field_;
 | 
				
			||||||
@ -1785,16 +1781,13 @@ class PropertyMatcher {
 | 
				
			|||||||
  template <typename T>
 | 
					  template <typename T>
 | 
				
			||||||
  bool MatchAndExplain(const T&value, MatchResultListener* listener) const {
 | 
					  bool MatchAndExplain(const T&value, MatchResultListener* listener) const {
 | 
				
			||||||
    return MatchAndExplainImpl(
 | 
					    return MatchAndExplainImpl(
 | 
				
			||||||
        typename ::testing::internal::
 | 
					        typename std::is_pointer<GTEST_REMOVE_CONST_(T)>::type(), value,
 | 
				
			||||||
            is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
 | 
					        listener);
 | 
				
			||||||
        value, listener);
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
  // The first argument of MatchAndExplainImpl() is needed to help
 | 
					  bool MatchAndExplainImpl(std::false_type /* is_not_pointer */,
 | 
				
			||||||
  // Symbian's C++ compiler choose which overload to use.  Its type is
 | 
					                           const Class& obj,
 | 
				
			||||||
  // true_type iff the Property() matcher is used to match a pointer.
 | 
					 | 
				
			||||||
  bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,
 | 
					 | 
				
			||||||
                           MatchResultListener* listener) const {
 | 
					                           MatchResultListener* listener) const {
 | 
				
			||||||
    *listener << whose_property_ << "is ";
 | 
					    *listener << whose_property_ << "is ";
 | 
				
			||||||
    // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
 | 
					    // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
 | 
				
			||||||
@ -1803,7 +1796,7 @@ class PropertyMatcher {
 | 
				
			|||||||
    return MatchPrintAndExplain(result, matcher_, listener);
 | 
					    return MatchPrintAndExplain(result, matcher_, listener);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
 | 
					  bool MatchAndExplainImpl(std::true_type /* is_pointer */, const Class* p,
 | 
				
			||||||
                           MatchResultListener* listener) const {
 | 
					                           MatchResultListener* listener) const {
 | 
				
			||||||
    if (p == nullptr) return false;
 | 
					    if (p == nullptr) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1811,7 +1804,7 @@ class PropertyMatcher {
 | 
				
			|||||||
    // Since *p has a property method, it must be a class/struct/union
 | 
					    // Since *p has a property method, it must be a class/struct/union
 | 
				
			||||||
    // type and thus cannot be a pointer.  Therefore we pass
 | 
					    // type and thus cannot be a pointer.  Therefore we pass
 | 
				
			||||||
    // false_type() as the first argument.
 | 
					    // false_type() as the first argument.
 | 
				
			||||||
    return MatchAndExplainImpl(false_type(), *p, listener);
 | 
					    return MatchAndExplainImpl(std::false_type(), *p, listener);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Property property_;
 | 
					  Property property_;
 | 
				
			||||||
 | 
				
			|||||||
@ -301,12 +301,7 @@ class OnCallSpec : public UntypedOnCallSpecBase {
 | 
				
			|||||||
             const ArgumentMatcherTuple& matchers)
 | 
					             const ArgumentMatcherTuple& matchers)
 | 
				
			||||||
      : UntypedOnCallSpecBase(a_file, a_line),
 | 
					      : UntypedOnCallSpecBase(a_file, a_line),
 | 
				
			||||||
        matchers_(matchers),
 | 
					        matchers_(matchers),
 | 
				
			||||||
        // By default, extra_matcher_ should match anything.  However,
 | 
					        extra_matcher_(_) {}
 | 
				
			||||||
        // we cannot initialize it with _ as that triggers a compiler
 | 
					 | 
				
			||||||
        // bug in Symbian's C++ compiler (cannot decide between two
 | 
					 | 
				
			||||||
        // overloaded constructors of Matcher<const ArgumentTuple&>).
 | 
					 | 
				
			||||||
        extra_matcher_(A<const ArgumentTuple&>()) {
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Implements the .With() clause.
 | 
					  // Implements the .With() clause.
 | 
				
			||||||
  OnCallSpec& With(const Matcher<const ArgumentTuple&>& m) {
 | 
					  OnCallSpec& With(const Matcher<const ArgumentTuple&>& m) {
 | 
				
			||||||
@ -896,11 +891,7 @@ class TypedExpectation : public ExpectationBase {
 | 
				
			|||||||
      : ExpectationBase(a_file, a_line, a_source_text),
 | 
					      : ExpectationBase(a_file, a_line, a_source_text),
 | 
				
			||||||
        owner_(owner),
 | 
					        owner_(owner),
 | 
				
			||||||
        matchers_(m),
 | 
					        matchers_(m),
 | 
				
			||||||
        // By default, extra_matcher_ should match anything.  However,
 | 
					        extra_matcher_(_),
 | 
				
			||||||
        // we cannot initialize it with _ as that triggers a compiler
 | 
					 | 
				
			||||||
        // bug in Symbian's C++ compiler (cannot decide between two
 | 
					 | 
				
			||||||
        // overloaded constructors of Matcher<const ArgumentTuple&>).
 | 
					 | 
				
			||||||
        extra_matcher_(A<const ArgumentTuple&>()),
 | 
					 | 
				
			||||||
        repeated_action_(DoDefault()) {}
 | 
					        repeated_action_(DoDefault()) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ~TypedExpectation() override {
 | 
					  ~TypedExpectation() override {
 | 
				
			||||||
 | 
				
			|||||||
@ -43,6 +43,7 @@
 | 
				
			|||||||
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
 | 
					#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gmock/internal/gmock-port.h"
 | 
					#include "gmock/internal/gmock-port.h"
 | 
				
			||||||
 | 
					#include "gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace testing {
 | 
					namespace testing {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -51,19 +52,6 @@ class Matcher;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace internal {
 | 
					namespace internal {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// An IgnoredValue object can be implicitly constructed from ANY value.
 | 
					 | 
				
			||||||
// This is used in implementing the IgnoreResult(a) action.
 | 
					 | 
				
			||||||
class IgnoredValue {
 | 
					 | 
				
			||||||
 public:
 | 
					 | 
				
			||||||
  // This constructor template allows any value to be implicitly
 | 
					 | 
				
			||||||
  // converted to IgnoredValue.  The object has no data member and
 | 
					 | 
				
			||||||
  // doesn't try to remember anything about the argument.  We
 | 
					 | 
				
			||||||
  // deliberately omit the 'explicit' keyword in order to allow the
 | 
					 | 
				
			||||||
  // conversion to be implicit.
 | 
					 | 
				
			||||||
  template <typename T>
 | 
					 | 
				
			||||||
  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// MatcherTuple<T>::type is a tuple type where each field is a Matcher
 | 
					// MatcherTuple<T>::type is a tuple type where each field is a Matcher
 | 
				
			||||||
// for the corresponding field in tuple type T.
 | 
					// for the corresponding field in tuple type T.
 | 
				
			||||||
template <typename Tuple>
 | 
					template <typename Tuple>
 | 
				
			||||||
 | 
				
			|||||||
@ -44,6 +44,7 @@ $var n = 10  $$ The maximum arity we support.
 | 
				
			|||||||
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
 | 
					#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gmock/internal/gmock-port.h"
 | 
					#include "gmock/internal/gmock-port.h"
 | 
				
			||||||
 | 
					#include "gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace testing {
 | 
					namespace testing {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -52,19 +53,6 @@ class Matcher;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace internal {
 | 
					namespace internal {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// An IgnoredValue object can be implicitly constructed from ANY value.
 | 
					 | 
				
			||||||
// This is used in implementing the IgnoreResult(a) action.
 | 
					 | 
				
			||||||
class IgnoredValue {
 | 
					 | 
				
			||||||
 public:
 | 
					 | 
				
			||||||
  // This constructor template allows any value to be implicitly
 | 
					 | 
				
			||||||
  // converted to IgnoredValue.  The object has no data member and
 | 
					 | 
				
			||||||
  // doesn't try to remember anything about the argument.  We
 | 
					 | 
				
			||||||
  // deliberately omit the 'explicit' keyword in order to allow the
 | 
					 | 
				
			||||||
  // conversion to be implicit.
 | 
					 | 
				
			||||||
  template <typename T>
 | 
					 | 
				
			||||||
  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// MatcherTuple<T>::type is a tuple type where each field is a Matcher
 | 
					// MatcherTuple<T>::type is a tuple type where each field is a Matcher
 | 
				
			||||||
// for the corresponding field in tuple type T.
 | 
					// for the corresponding field in tuple type T.
 | 
				
			||||||
template <typename Tuple>
 | 
					template <typename Tuple>
 | 
				
			||||||
 | 
				
			|||||||
@ -92,16 +92,11 @@ inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {
 | 
				
			|||||||
template <typename Element>
 | 
					template <typename Element>
 | 
				
			||||||
inline Element* GetRawPointer(Element* p) { return p; }
 | 
					inline Element* GetRawPointer(Element* p) { return p; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Symbian compilation can be done with wchar_t being either a native
 | 
					 | 
				
			||||||
// type or a typedef.  Using Google Mock with OpenC without wchar_t
 | 
					 | 
				
			||||||
// should require the definition of _STLP_NO_WCHAR_T.
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
// MSVC treats wchar_t as a native type usually, but treats it as the
 | 
					// MSVC treats wchar_t as a native type usually, but treats it as the
 | 
				
			||||||
// same as unsigned short when the compiler option /Zc:wchar_t- is
 | 
					// same as unsigned short when the compiler option /Zc:wchar_t- is
 | 
				
			||||||
// specified.  It defines _NATIVE_WCHAR_T_DEFINED symbol when wchar_t
 | 
					// specified.  It defines _NATIVE_WCHAR_T_DEFINED symbol when wchar_t
 | 
				
			||||||
// is a native type.
 | 
					// is a native type.
 | 
				
			||||||
#if (GTEST_OS_SYMBIAN && defined(_STLP_NO_WCHAR_T)) || \
 | 
					#if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED)
 | 
				
			||||||
    (defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED))
 | 
					 | 
				
			||||||
// wchar_t is a typedef.
 | 
					// wchar_t is a typedef.
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
# define GMOCK_WCHAR_T_IS_NATIVE_ 1
 | 
					# define GMOCK_WCHAR_T_IS_NATIVE_ 1
 | 
				
			||||||
@ -452,32 +447,10 @@ class StlContainerView<Element[N]> {
 | 
				
			|||||||
  static const_reference ConstReference(const Element (&array)[N]) {
 | 
					  static const_reference ConstReference(const Element (&array)[N]) {
 | 
				
			||||||
    // Ensures that Element is not a const type.
 | 
					    // Ensures that Element is not a const type.
 | 
				
			||||||
    testing::StaticAssertTypeEq<Element, RawElement>();
 | 
					    testing::StaticAssertTypeEq<Element, RawElement>();
 | 
				
			||||||
#if GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
    // The Nokia Symbian compiler confuses itself in template instantiation
 | 
					 | 
				
			||||||
    // for this call without the cast to Element*:
 | 
					 | 
				
			||||||
    // function call '[testing::internal::NativeArray<char *>].NativeArray(
 | 
					 | 
				
			||||||
    //     {lval} const char *[4], long, testing::internal::RelationToSource)'
 | 
					 | 
				
			||||||
    //     does not match
 | 
					 | 
				
			||||||
    // 'testing::internal::NativeArray<char *>::NativeArray(
 | 
					 | 
				
			||||||
    //     char *const *, unsigned int, testing::internal::RelationToSource)'
 | 
					 | 
				
			||||||
    // (instantiating: 'testing::internal::ContainsMatcherImpl
 | 
					 | 
				
			||||||
    //     <const char * (&)[4]>::Matches(const char * (&)[4]) const')
 | 
					 | 
				
			||||||
    // (instantiating: 'testing::internal::StlContainerView<char *[4]>::
 | 
					 | 
				
			||||||
    //     ConstReference(const char * (&)[4])')
 | 
					 | 
				
			||||||
    // (and though the N parameter type is mismatched in the above explicit
 | 
					 | 
				
			||||||
    // conversion of it doesn't help - only the conversion of the array).
 | 
					 | 
				
			||||||
    return type(const_cast<Element*>(&array[0]), N,
 | 
					 | 
				
			||||||
                RelationToSourceReference());
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
    return type(array, N, RelationToSourceReference());
 | 
					    return type(array, N, RelationToSourceReference());
 | 
				
			||||||
#endif  // GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  static type Copy(const Element (&array)[N]) {
 | 
					  static type Copy(const Element (&array)[N]) {
 | 
				
			||||||
#if GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
    return type(const_cast<Element*>(&array[0]), N, RelationToSourceCopy());
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
    return type(array, N, RelationToSourceCopy());
 | 
					    return type(array, N, RelationToSourceCopy());
 | 
				
			||||||
#endif  // GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -154,9 +154,6 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
 | 
				
			|||||||
  // Ensures that logs from different threads don't interleave.
 | 
					  // Ensures that logs from different threads don't interleave.
 | 
				
			||||||
  MutexLock l(&g_log_mutex);
 | 
					  MutexLock l(&g_log_mutex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is a
 | 
					 | 
				
			||||||
  // macro.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (severity == kWarning) {
 | 
					  if (severity == kWarning) {
 | 
				
			||||||
    // Prints a GMOCK WARNING marker to make the warnings easily searchable.
 | 
					    // Prints a GMOCK WARNING marker to make the warnings easily searchable.
 | 
				
			||||||
    std::cout << "\nGMOCK WARNING:";
 | 
					    std::cout << "\nGMOCK WARNING:";
 | 
				
			||||||
 | 
				
			|||||||
@ -592,9 +592,6 @@ class MockObjectRegistry {
 | 
				
			|||||||
  // object alive.  Therefore we report any living object as test
 | 
					  // object alive.  Therefore we report any living object as test
 | 
				
			||||||
  // failure, unless the user explicitly asked us to ignore it.
 | 
					  // failure, unless the user explicitly asked us to ignore it.
 | 
				
			||||||
  ~MockObjectRegistry() {
 | 
					  ~MockObjectRegistry() {
 | 
				
			||||||
    // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is
 | 
					 | 
				
			||||||
    // a macro.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!GMOCK_FLAG(catch_leaked_mocks))
 | 
					    if (!GMOCK_FLAG(catch_leaked_mocks))
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -444,19 +444,12 @@ class IsNotZero : public ActionInterface<bool(int)> {  // NOLINT
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
// Compiling this test on Nokia's Symbian compiler fails with:
 | 
					 | 
				
			||||||
//  'Result' is not a member of class 'testing::internal::Function<int>'
 | 
					 | 
				
			||||||
//  (point of instantiation: '@unnamed@gmock_actions_test_cc@::
 | 
					 | 
				
			||||||
//      ActionTest_CanBeConvertedToOtherActionType_Test::TestBody()')
 | 
					 | 
				
			||||||
// with no obvious fix.
 | 
					 | 
				
			||||||
TEST(ActionTest, CanBeConvertedToOtherActionType) {
 | 
					TEST(ActionTest, CanBeConvertedToOtherActionType) {
 | 
				
			||||||
  const Action<bool(int)> a1(new IsNotZero);  // NOLINT
 | 
					  const Action<bool(int)> a1(new IsNotZero);  // NOLINT
 | 
				
			||||||
  const Action<int(char)> a2 = Action<int(char)>(a1);  // NOLINT
 | 
					  const Action<int(char)> a2 = Action<int(char)>(a1);  // NOLINT
 | 
				
			||||||
  EXPECT_EQ(1, a2.Perform(std::make_tuple('a')));
 | 
					  EXPECT_EQ(1, a2.Perform(std::make_tuple('a')));
 | 
				
			||||||
  EXPECT_EQ(0, a2.Perform(std::make_tuple('\0')));
 | 
					  EXPECT_EQ(0, a2.Perform(std::make_tuple('\0')));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// The following two classes are for testing MakePolymorphicAction().
 | 
					// The following two classes are for testing MakePolymorphicAction().
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -805,9 +798,7 @@ TEST(SetArgPointeeTest, SetsTheNthPointee) {
 | 
				
			|||||||
  EXPECT_EQ('a', ch);
 | 
					  EXPECT_EQ('a', ch);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
 | 
					 | 
				
			||||||
// Tests that SetArgPointee<N>() accepts a string literal.
 | 
					// Tests that SetArgPointee<N>() accepts a string literal.
 | 
				
			||||||
// GCC prior to v4.0 and the Symbian compiler do not support this.
 | 
					 | 
				
			||||||
TEST(SetArgPointeeTest, AcceptsStringLiteral) {
 | 
					TEST(SetArgPointeeTest, AcceptsStringLiteral) {
 | 
				
			||||||
  typedef void MyFunction(std::string*, const char**);
 | 
					  typedef void MyFunction(std::string*, const char**);
 | 
				
			||||||
  Action<MyFunction> a = SetArgPointee<0>("hi");
 | 
					  Action<MyFunction> a = SetArgPointee<0>("hi");
 | 
				
			||||||
@ -841,7 +832,6 @@ TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# endif
 | 
					# endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests that SetArgPointee<N>() accepts a char pointer.
 | 
					// Tests that SetArgPointee<N>() accepts a char pointer.
 | 
				
			||||||
TEST(SetArgPointeeTest, AcceptsCharPointer) {
 | 
					TEST(SetArgPointeeTest, AcceptsCharPointer) {
 | 
				
			||||||
 | 
				
			|||||||
@ -45,13 +45,6 @@
 | 
				
			|||||||
#include "gmock/gmock.h"
 | 
					#include "gmock/gmock.h"
 | 
				
			||||||
#include "gtest/gtest.h"
 | 
					#include "gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// There is a bug in MSVC (fixed in VS 2008) that prevents creating a
 | 
					 | 
				
			||||||
// mock for a function with const arguments, so we don't test such
 | 
					 | 
				
			||||||
// cases for MSVC versions older than 2008.
 | 
					 | 
				
			||||||
#if !GTEST_OS_WINDOWS || (_MSC_VER >= 1500)
 | 
					 | 
				
			||||||
# define GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
 | 
					 | 
				
			||||||
#endif  // !GTEST_OS_WINDOWS || (_MSC_VER >= 1500)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace testing {
 | 
					namespace testing {
 | 
				
			||||||
namespace gmock_function_mocker_test {
 | 
					namespace gmock_function_mocker_test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -84,9 +77,7 @@ class FooInterface {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual bool TakesNonConstReference(int& n) = 0;  // NOLINT
 | 
					  virtual bool TakesNonConstReference(int& n) = 0;  // NOLINT
 | 
				
			||||||
  virtual std::string TakesConstReference(const int& n) = 0;
 | 
					  virtual std::string TakesConstReference(const int& n) = 0;
 | 
				
			||||||
#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
 | 
					 | 
				
			||||||
  virtual bool TakesConst(const int x) = 0;
 | 
					  virtual bool TakesConst(const int x) = 0;
 | 
				
			||||||
#endif  // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  virtual int OverloadedOnArgumentNumber() = 0;
 | 
					  virtual int OverloadedOnArgumentNumber() = 0;
 | 
				
			||||||
  virtual int OverloadedOnArgumentNumber(int n) = 0;
 | 
					  virtual int OverloadedOnArgumentNumber(int n) = 0;
 | 
				
			||||||
@ -137,10 +128,7 @@ class MockFoo : public FooInterface {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  MOCK_METHOD(bool, TakesNonConstReference, (int&));  // NOLINT
 | 
					  MOCK_METHOD(bool, TakesNonConstReference, (int&));  // NOLINT
 | 
				
			||||||
  MOCK_METHOD(std::string, TakesConstReference, (const int&));
 | 
					  MOCK_METHOD(std::string, TakesConstReference, (const int&));
 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
 | 
					 | 
				
			||||||
  MOCK_METHOD(bool, TakesConst, (const int));  // NOLINT
 | 
					  MOCK_METHOD(bool, TakesConst, (const int));  // NOLINT
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Tests that the function return type can contain unprotected comma.
 | 
					  // Tests that the function return type can contain unprotected comma.
 | 
				
			||||||
  MOCK_METHOD((std::map<int, std::string>), ReturnTypeWithComma, (), ());
 | 
					  MOCK_METHOD((std::map<int, std::string>), ReturnTypeWithComma, (), ());
 | 
				
			||||||
@ -248,7 +236,6 @@ TEST_F(MockMethodFunctionMockerTest, MocksFunctionWithConstReferenceArgument) {
 | 
				
			|||||||
  EXPECT_EQ("Hello", foo_->TakesConstReference(a));
 | 
					  EXPECT_EQ("Hello", foo_->TakesConstReference(a));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
 | 
					 | 
				
			||||||
// Tests mocking a function that takes a const variable.
 | 
					// Tests mocking a function that takes a const variable.
 | 
				
			||||||
TEST_F(MockMethodFunctionMockerTest, MocksFunctionWithConstArgument) {
 | 
					TEST_F(MockMethodFunctionMockerTest, MocksFunctionWithConstArgument) {
 | 
				
			||||||
  EXPECT_CALL(mock_foo_, TakesConst(Lt(10)))
 | 
					  EXPECT_CALL(mock_foo_, TakesConst(Lt(10)))
 | 
				
			||||||
@ -256,7 +243,6 @@ TEST_F(MockMethodFunctionMockerTest, MocksFunctionWithConstArgument) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  EXPECT_FALSE(foo_->TakesConst(5));
 | 
					  EXPECT_FALSE(foo_->TakesConst(5));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif  // GMOCK_ALLOWS_CONST_PARAM_FUNCTIONS
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests mocking functions overloaded on the number of arguments.
 | 
					// Tests mocking functions overloaded on the number of arguments.
 | 
				
			||||||
TEST_F(MockMethodFunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber) {
 | 
					TEST_F(MockMethodFunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber) {
 | 
				
			||||||
 | 
				
			|||||||
@ -145,7 +145,6 @@ TEST(GetRawPointerTest, WorksForSmartPointers) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
TEST(GetRawPointerTest, WorksForRawPointers) {
 | 
					TEST(GetRawPointerTest, WorksForRawPointers) {
 | 
				
			||||||
  int* p = nullptr;
 | 
					  int* p = nullptr;
 | 
				
			||||||
  // Don't use EXPECT_EQ as no NULL-testing magic on Symbian.
 | 
					 | 
				
			||||||
  EXPECT_TRUE(nullptr == GetRawPointer(p));
 | 
					  EXPECT_TRUE(nullptr == GetRawPointer(p));
 | 
				
			||||||
  int n = 1;
 | 
					  int n = 1;
 | 
				
			||||||
  EXPECT_EQ(&n, GetRawPointer(&n));
 | 
					  EXPECT_EQ(&n, GetRawPointer(&n));
 | 
				
			||||||
@ -521,12 +520,6 @@ TEST(TypeTraitsTest, is_reference) {
 | 
				
			|||||||
  EXPECT_TRUE(is_reference<const int&>::value);
 | 
					  EXPECT_TRUE(is_reference<const int&>::value);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(TypeTraitsTest, is_pointer) {
 | 
					 | 
				
			||||||
  EXPECT_FALSE(is_pointer<int>::value);
 | 
					 | 
				
			||||||
  EXPECT_FALSE(is_pointer<char&>::value);
 | 
					 | 
				
			||||||
  EXPECT_TRUE(is_pointer<const int*>::value);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST(TypeTraitsTest, type_equals) {
 | 
					TEST(TypeTraitsTest, type_equals) {
 | 
				
			||||||
  EXPECT_FALSE((type_equals<int, const int>::value));
 | 
					  EXPECT_FALSE((type_equals<int, const int>::value));
 | 
				
			||||||
  EXPECT_FALSE((type_equals<int, int&>::value));
 | 
					  EXPECT_FALSE((type_equals<int, int&>::value));
 | 
				
			||||||
 | 
				
			|||||||
@ -1167,20 +1167,10 @@ TEST(IsNullTest, MatchesNullPointer) {
 | 
				
			|||||||
  EXPECT_TRUE(m2.Matches(p2));
 | 
					  EXPECT_TRUE(m2.Matches(p2));
 | 
				
			||||||
  EXPECT_FALSE(m2.Matches("hi"));
 | 
					  EXPECT_FALSE(m2.Matches("hi"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  // Nokia's Symbian compiler generates:
 | 
					 | 
				
			||||||
  // gmock-matchers.h: ambiguous access to overloaded function
 | 
					 | 
				
			||||||
  // gmock-matchers.h: 'testing::Matcher<void *>::Matcher(void *)'
 | 
					 | 
				
			||||||
  // gmock-matchers.h: 'testing::Matcher<void *>::Matcher(const testing::
 | 
					 | 
				
			||||||
  //     MatcherInterface<void *> *)'
 | 
					 | 
				
			||||||
  // gmock-matchers.h:  (point of instantiation: 'testing::
 | 
					 | 
				
			||||||
  //     gmock_matchers_test::IsNullTest_MatchesNullPointer_Test::TestBody()')
 | 
					 | 
				
			||||||
  // gmock-matchers.h:   (instantiating: 'testing::PolymorphicMatc
 | 
					 | 
				
			||||||
  Matcher<void*> m3 = IsNull();
 | 
					  Matcher<void*> m3 = IsNull();
 | 
				
			||||||
  void* p3 = nullptr;
 | 
					  void* p3 = nullptr;
 | 
				
			||||||
  EXPECT_TRUE(m3.Matches(p3));
 | 
					  EXPECT_TRUE(m3.Matches(p3));
 | 
				
			||||||
  EXPECT_FALSE(m3.Matches(reinterpret_cast<void*>(0xbeef)));
 | 
					  EXPECT_FALSE(m3.Matches(reinterpret_cast<void*>(0xbeef)));
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(IsNullTest, StdFunction) {
 | 
					TEST(IsNullTest, StdFunction) {
 | 
				
			||||||
@ -3168,20 +3158,8 @@ TEST(MatcherAssertionTest, WorksForByRefArguments) {
 | 
				
			|||||||
                       "Actual: 0" + OfType("int") + ", which is located @");
 | 
					                       "Actual: 0" + OfType("int") + ", which is located @");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
// Tests that ASSERT_THAT() and EXPECT_THAT() work when the matcher is
 | 
					// Tests that ASSERT_THAT() and EXPECT_THAT() work when the matcher is
 | 
				
			||||||
// monomorphic.
 | 
					// monomorphic.
 | 
				
			||||||
 | 
					 | 
				
			||||||
// ASSERT_THAT("hello", starts_with_he) fails to compile with Nokia's
 | 
					 | 
				
			||||||
// Symbian compiler: it tries to compile
 | 
					 | 
				
			||||||
// template<T, U> class MatcherCastImpl { ...
 | 
					 | 
				
			||||||
//   virtual bool MatchAndExplain(T x, ...) const {
 | 
					 | 
				
			||||||
//     return source_matcher_.MatchAndExplain(static_cast<U>(x), ...);
 | 
					 | 
				
			||||||
// with U == string and T == const char*
 | 
					 | 
				
			||||||
// With ASSERT_THAT("hello"...) changed to ASSERT_THAT(string("hello") ... )
 | 
					 | 
				
			||||||
// the compiler silently crashes with no output.
 | 
					 | 
				
			||||||
// If MatcherCastImpl is changed to use U(x) instead of static_cast<U>(x)
 | 
					 | 
				
			||||||
// the code compiles but the converted string is bogus.
 | 
					 | 
				
			||||||
TEST(MatcherAssertionTest, WorksForMonomorphicMatcher) {
 | 
					TEST(MatcherAssertionTest, WorksForMonomorphicMatcher) {
 | 
				
			||||||
  Matcher<const char*> starts_with_he = StartsWith("he");
 | 
					  Matcher<const char*> starts_with_he = StartsWith("he");
 | 
				
			||||||
  ASSERT_THAT("hello", starts_with_he);
 | 
					  ASSERT_THAT("hello", starts_with_he);
 | 
				
			||||||
@ -3199,7 +3177,6 @@ TEST(MatcherAssertionTest, WorksForMonomorphicMatcher) {
 | 
				
			|||||||
                          "Expected: is > 5\n"
 | 
					                          "Expected: is > 5\n"
 | 
				
			||||||
                          "  Actual: 5" + OfType("int"));
 | 
					                          "  Actual: 5" + OfType("int"));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests floating-point matchers.
 | 
					// Tests floating-point matchers.
 | 
				
			||||||
template <typename RawType>
 | 
					template <typename RawType>
 | 
				
			||||||
 | 
				
			|||||||
@ -294,21 +294,13 @@ TEST(NiceMockTest, MoveOnlyConstructor) {
 | 
				
			|||||||
  NiceMock<MockBaz> nice_baz(MockBaz::MoveOnly{});
 | 
					  NiceMock<MockBaz> nice_baz(MockBaz::MoveOnly{});
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
 | 
					 | 
				
			||||||
// Tests that NiceMock<Mock> compiles where Mock is a user-defined
 | 
					// Tests that NiceMock<Mock> compiles where Mock is a user-defined
 | 
				
			||||||
// class (as opposed to ::testing::Mock).  We had to work around an
 | 
					// class (as opposed to ::testing::Mock).
 | 
				
			||||||
// MSVC 8.0 bug that caused the symbol Mock used in the definition of
 | 
					 | 
				
			||||||
// NiceMock to be looked up in the wrong context, and this test
 | 
					 | 
				
			||||||
// ensures that our fix works.
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
// We have to skip this test on Symbian and Windows Mobile, as it
 | 
					 | 
				
			||||||
// causes the program to crash there, for reasons unclear to us yet.
 | 
					 | 
				
			||||||
TEST(NiceMockTest, AcceptsClassNamedMock) {
 | 
					TEST(NiceMockTest, AcceptsClassNamedMock) {
 | 
				
			||||||
  NiceMock< ::Mock> nice;
 | 
					  NiceMock< ::Mock> nice;
 | 
				
			||||||
  EXPECT_CALL(nice, DoThis());
 | 
					  EXPECT_CALL(nice, DoThis());
 | 
				
			||||||
  nice.DoThis();
 | 
					  nice.DoThis();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(NiceMockTest, IsNaggy_IsNice_IsStrict) {
 | 
					TEST(NiceMockTest, IsNaggy_IsNice_IsStrict) {
 | 
				
			||||||
  NiceMock<MockFoo> nice_foo;
 | 
					  NiceMock<MockFoo> nice_foo;
 | 
				
			||||||
@ -405,21 +397,13 @@ TEST(NaggyMockTest, MoveOnlyConstructor) {
 | 
				
			|||||||
  NaggyMock<MockBaz> naggy_baz(MockBaz::MoveOnly{});
 | 
					  NaggyMock<MockBaz> naggy_baz(MockBaz::MoveOnly{});
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
 | 
					 | 
				
			||||||
// Tests that NaggyMock<Mock> compiles where Mock is a user-defined
 | 
					// Tests that NaggyMock<Mock> compiles where Mock is a user-defined
 | 
				
			||||||
// class (as opposed to ::testing::Mock).  We had to work around an
 | 
					// class (as opposed to ::testing::Mock).
 | 
				
			||||||
// MSVC 8.0 bug that caused the symbol Mock used in the definition of
 | 
					 | 
				
			||||||
// NaggyMock to be looked up in the wrong context, and this test
 | 
					 | 
				
			||||||
// ensures that our fix works.
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
// We have to skip this test on Symbian and Windows Mobile, as it
 | 
					 | 
				
			||||||
// causes the program to crash there, for reasons unclear to us yet.
 | 
					 | 
				
			||||||
TEST(NaggyMockTest, AcceptsClassNamedMock) {
 | 
					TEST(NaggyMockTest, AcceptsClassNamedMock) {
 | 
				
			||||||
  NaggyMock< ::Mock> naggy;
 | 
					  NaggyMock< ::Mock> naggy;
 | 
				
			||||||
  EXPECT_CALL(naggy, DoThis());
 | 
					  EXPECT_CALL(naggy, DoThis());
 | 
				
			||||||
  naggy.DoThis();
 | 
					  naggy.DoThis();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(NaggyMockTest, IsNaggy_IsNice_IsStrict) {
 | 
					TEST(NaggyMockTest, IsNaggy_IsNice_IsStrict) {
 | 
				
			||||||
  NaggyMock<MockFoo> naggy_foo;
 | 
					  NaggyMock<MockFoo> naggy_foo;
 | 
				
			||||||
@ -497,21 +481,13 @@ TEST(StrictMockTest, MoveOnlyConstructor) {
 | 
				
			|||||||
  StrictMock<MockBaz> strict_baz(MockBaz::MoveOnly{});
 | 
					  StrictMock<MockBaz> strict_baz(MockBaz::MoveOnly{});
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
 | 
					 | 
				
			||||||
// Tests that StrictMock<Mock> compiles where Mock is a user-defined
 | 
					// Tests that StrictMock<Mock> compiles where Mock is a user-defined
 | 
				
			||||||
// class (as opposed to ::testing::Mock).  We had to work around an
 | 
					// class (as opposed to ::testing::Mock).
 | 
				
			||||||
// MSVC 8.0 bug that caused the symbol Mock used in the definition of
 | 
					 | 
				
			||||||
// StrictMock to be looked up in the wrong context, and this test
 | 
					 | 
				
			||||||
// ensures that our fix works.
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
// We have to skip this test on Symbian and Windows Mobile, as it
 | 
					 | 
				
			||||||
// causes the program to crash there, for reasons unclear to us yet.
 | 
					 | 
				
			||||||
TEST(StrictMockTest, AcceptsClassNamedMock) {
 | 
					TEST(StrictMockTest, AcceptsClassNamedMock) {
 | 
				
			||||||
  StrictMock< ::Mock> strict;
 | 
					  StrictMock< ::Mock> strict;
 | 
				
			||||||
  EXPECT_CALL(strict, DoThis());
 | 
					  EXPECT_CALL(strict, DoThis());
 | 
				
			||||||
  strict.DoThis();
 | 
					  strict.DoThis();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN && !GTEST_OS_WINDOWS_MOBILE
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(StrictMockTest, IsNaggy_IsNice_IsStrict) {
 | 
					TEST(StrictMockTest, IsNaggy_IsNice_IsStrict) {
 | 
				
			||||||
  StrictMock<MockFoo> strict_foo;
 | 
					  StrictMock<MockFoo> strict_foo;
 | 
				
			||||||
 | 
				
			|||||||
@ -107,14 +107,6 @@ class GTEST_API_ Message {
 | 
				
			|||||||
    *ss_ << str;
 | 
					    *ss_ << str;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  // Streams a value (either a pointer or not) to this object.
 | 
					 | 
				
			||||||
  template <typename T>
 | 
					 | 
				
			||||||
  inline Message& operator <<(const T& value) {
 | 
					 | 
				
			||||||
    StreamHelper(typename internal::is_pointer<T>::type(), value);
 | 
					 | 
				
			||||||
    return *this;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
  // Streams a non-pointer value to this object.
 | 
					  // Streams a non-pointer value to this object.
 | 
				
			||||||
  template <typename T>
 | 
					  template <typename T>
 | 
				
			||||||
  inline Message& operator <<(const T& val) {
 | 
					  inline Message& operator <<(const T& val) {
 | 
				
			||||||
@ -159,7 +151,6 @@ class GTEST_API_ Message {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    return *this;
 | 
					    return *this;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif  // GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Since the basic IO manipulators are overloaded for both narrow
 | 
					  // Since the basic IO manipulators are overloaded for both narrow
 | 
				
			||||||
  // and wide streams, we have to provide this specialized definition
 | 
					  // and wide streams, we have to provide this specialized definition
 | 
				
			||||||
@ -201,29 +192,6 @@ class GTEST_API_ Message {
 | 
				
			|||||||
  std::string GetString() const;
 | 
					  std::string GetString() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
#if GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  // These are needed as the Nokia Symbian Compiler cannot decide between
 | 
					 | 
				
			||||||
  // const T& and const T* in a function template. The Nokia compiler _can_
 | 
					 | 
				
			||||||
  // decide between class template specializations for T and T*, so a
 | 
					 | 
				
			||||||
  // tr1::type_traits-like is_pointer works, and we can overload on that.
 | 
					 | 
				
			||||||
  template <typename T>
 | 
					 | 
				
			||||||
  inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
 | 
					 | 
				
			||||||
    if (pointer == nullptr) {
 | 
					 | 
				
			||||||
      *ss_ << "(null)";
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
      *ss_ << pointer;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  template <typename T>
 | 
					 | 
				
			||||||
  inline void StreamHelper(internal::false_type /*is_pointer*/,
 | 
					 | 
				
			||||||
                           const T& value) {
 | 
					 | 
				
			||||||
    // See the comments in Message& operator <<(const T&) above for why
 | 
					 | 
				
			||||||
    // we need this using statement.
 | 
					 | 
				
			||||||
    using ::operator <<;
 | 
					 | 
				
			||||||
    *ss_ << value;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
#endif  // GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // We'll hold the text streamed to this object here.
 | 
					  // We'll hold the text streamed to this object here.
 | 
				
			||||||
  const std::unique_ptr< ::std::stringstream> ss_;
 | 
					  const std::unique_ptr< ::std::stringstream> ss_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -178,15 +178,12 @@ TEST_P(DerivedTest, DoesBlah) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#endif  // 0
 | 
					#endif  // 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gtest/internal/gtest-port.h"
 | 
					#include <utility>
 | 
				
			||||||
 | 
					 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
# include <utility>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gtest/internal/gtest-internal.h"
 | 
					#include "gtest/internal/gtest-internal.h"
 | 
				
			||||||
#include "gtest/internal/gtest-param-util.h"
 | 
					#include "gtest/internal/gtest-param-util.h"
 | 
				
			||||||
#include "gtest/internal/gtest-param-util-generated.h"
 | 
					#include "gtest/internal/gtest-param-util-generated.h"
 | 
				
			||||||
 | 
					#include "gtest/internal/gtest-port.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace testing {
 | 
					namespace testing {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -177,15 +177,12 @@ TEST_P(DerivedTest, DoesBlah) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#endif  // 0
 | 
					#endif  // 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gtest/internal/gtest-port.h"
 | 
					#include <utility>
 | 
				
			||||||
 | 
					 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
# include <utility>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gtest/internal/gtest-internal.h"
 | 
					#include "gtest/internal/gtest-internal.h"
 | 
				
			||||||
#include "gtest/internal/gtest-param-util.h"
 | 
					#include "gtest/internal/gtest-param-util.h"
 | 
				
			||||||
#include "gtest/internal/gtest-param-util-generated.h"
 | 
					#include "gtest/internal/gtest-param-util-generated.h"
 | 
				
			||||||
 | 
					#include "gtest/internal/gtest-port.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace testing {
 | 
					namespace testing {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -514,7 +514,7 @@ void PrintTo(const T& value, ::std::ostream* os) {
 | 
				
			|||||||
                  (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&
 | 
					                  (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&
 | 
				
			||||||
              !IsRecursiveContainer<T>::value
 | 
					              !IsRecursiveContainer<T>::value
 | 
				
			||||||
          ? kPrintContainer
 | 
					          ? kPrintContainer
 | 
				
			||||||
          : !is_pointer<T>::value
 | 
					          : !std::is_pointer<T>::value
 | 
				
			||||||
                ? kPrintOther
 | 
					                ? kPrintOther
 | 
				
			||||||
                : std::is_function<typename std::remove_pointer<T>::type>::value
 | 
					                : std::is_function<typename std::remove_pointer<T>::type>::value
 | 
				
			||||||
                      ? kPrintFunctionPointer
 | 
					                      ? kPrintFunctionPointer
 | 
				
			||||||
 | 
				
			|||||||
@ -1527,7 +1527,7 @@ class EqHelper<true> {
 | 
				
			|||||||
      // expands to Compare("", "", NULL, my_ptr), which requires a conversion
 | 
					      // expands to Compare("", "", NULL, my_ptr), which requires a conversion
 | 
				
			||||||
      // to match the Secret* in the other overload, which would otherwise make
 | 
					      // to match the Secret* in the other overload, which would otherwise make
 | 
				
			||||||
      // this template match better.
 | 
					      // this template match better.
 | 
				
			||||||
      typename EnableIf<!is_pointer<T2>::value>::type* = nullptr) {
 | 
					      typename EnableIf<!std::is_pointer<T2>::value>::type* = nullptr) {
 | 
				
			||||||
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
 | 
					    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -106,12 +106,22 @@ class UnitTestImpl;                    // Opaque implementation of UnitTest
 | 
				
			|||||||
// stack trace.
 | 
					// stack trace.
 | 
				
			||||||
GTEST_API_ extern const char kStackTraceMarker[];
 | 
					GTEST_API_ extern const char kStackTraceMarker[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// An IgnoredValue object can be implicitly constructed from ANY value.
 | 
				
			||||||
 | 
					class IgnoredValue {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  // This constructor template allows any value to be implicitly
 | 
				
			||||||
 | 
					  // converted to IgnoredValue.  The object has no data member and
 | 
				
			||||||
 | 
					  // doesn't try to remember anything about the argument.  We
 | 
				
			||||||
 | 
					  // deliberately omit the 'explicit' keyword in order to allow the
 | 
				
			||||||
 | 
					  // conversion to be implicit.
 | 
				
			||||||
 | 
					  template <typename T>
 | 
				
			||||||
 | 
					  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Two overloaded helpers for checking at compile time whether an
 | 
					// Two overloaded helpers for checking at compile time whether an
 | 
				
			||||||
// expression is a null pointer literal (i.e. NULL or any 0-valued
 | 
					// expression is a null pointer literal (i.e. NULL or any 0-valued
 | 
				
			||||||
// compile-time integral constant).  Their return values have
 | 
					// compile-time integral constant).  These helpers have no
 | 
				
			||||||
// different sizes, so we can use sizeof() to test which version is
 | 
					// implementations, as we only need their signatures.
 | 
				
			||||||
// picked by the compiler.  These helpers have no implementations, as
 | 
					 | 
				
			||||||
// we only need their signatures.
 | 
					 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Given IsNullLiteralHelper(x), the compiler will pick the first
 | 
					// Given IsNullLiteralHelper(x), the compiler will pick the first
 | 
				
			||||||
// version if x can be implicitly converted to Secret*, and pick the
 | 
					// version if x can be implicitly converted to Secret*, and pick the
 | 
				
			||||||
@ -120,20 +130,13 @@ GTEST_API_ extern const char kStackTraceMarker[];
 | 
				
			|||||||
// a null pointer literal.  Therefore, we know that x is a null
 | 
					// a null pointer literal.  Therefore, we know that x is a null
 | 
				
			||||||
// pointer literal if and only if the first version is picked by the
 | 
					// pointer literal if and only if the first version is picked by the
 | 
				
			||||||
// compiler.
 | 
					// compiler.
 | 
				
			||||||
char IsNullLiteralHelper(Secret* p);
 | 
					std::true_type IsNullLiteralHelper(Secret*);
 | 
				
			||||||
char (&IsNullLiteralHelper(...))[2];  // NOLINT
 | 
					std::false_type IsNullLiteralHelper(IgnoredValue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// A compile-time bool constant that is true if and only if x is a
 | 
					// A compile-time bool constant that is true if and only if x is a null pointer
 | 
				
			||||||
// null pointer literal (i.e. NULL or any 0-valued compile-time
 | 
					// literal (i.e. nullptr, NULL or any 0-valued compile-time integral constant).
 | 
				
			||||||
// integral constant).
 | 
					#define GTEST_IS_NULL_LITERAL_(x) \
 | 
				
			||||||
#ifdef GTEST_ELLIPSIS_NEEDS_POD_
 | 
					  decltype(::testing::internal::IsNullLiteralHelper(x))::value
 | 
				
			||||||
// We lose support for NULL detection where the compiler doesn't like
 | 
					 | 
				
			||||||
// passing non-POD classes through ellipsis (...).
 | 
					 | 
				
			||||||
# define GTEST_IS_NULL_LITERAL_(x) false
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
# define GTEST_IS_NULL_LITERAL_(x) \
 | 
					 | 
				
			||||||
    (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
 | 
					 | 
				
			||||||
#endif  // GTEST_ELLIPSIS_NEEDS_POD_
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Appends the user-supplied message to the Google-Test-generated message.
 | 
					// Appends the user-supplied message to the Google-Test-generated message.
 | 
				
			||||||
GTEST_API_ std::string AppendUserMessage(
 | 
					GTEST_API_ std::string AppendUserMessage(
 | 
				
			||||||
 | 
				
			|||||||
@ -41,8 +41,6 @@
 | 
				
			|||||||
# elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
 | 
					# elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
 | 
				
			||||||
#  define GTEST_OS_WINDOWS_MINGW 1
 | 
					#  define GTEST_OS_WINDOWS_MINGW 1
 | 
				
			||||||
#  define GTEST_OS_WINDOWS 1
 | 
					#  define GTEST_OS_WINDOWS 1
 | 
				
			||||||
#elif defined __SYMBIAN32__
 | 
					 | 
				
			||||||
# define GTEST_OS_SYMBIAN 1
 | 
					 | 
				
			||||||
#elif defined _WIN32
 | 
					#elif defined _WIN32
 | 
				
			||||||
# define GTEST_OS_WINDOWS 1
 | 
					# define GTEST_OS_WINDOWS 1
 | 
				
			||||||
# ifdef _WIN32_WCE
 | 
					# ifdef _WIN32_WCE
 | 
				
			||||||
 | 
				
			|||||||
@ -130,7 +130,6 @@
 | 
				
			|||||||
//   GTEST_OS_OS2      - OS/2
 | 
					//   GTEST_OS_OS2      - OS/2
 | 
				
			||||||
//   GTEST_OS_QNX      - QNX
 | 
					//   GTEST_OS_QNX      - QNX
 | 
				
			||||||
//   GTEST_OS_SOLARIS  - Sun Solaris
 | 
					//   GTEST_OS_SOLARIS  - Sun Solaris
 | 
				
			||||||
//   GTEST_OS_SYMBIAN  - Symbian
 | 
					 | 
				
			||||||
//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
 | 
					//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
 | 
				
			||||||
//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
 | 
					//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
 | 
				
			||||||
//     GTEST_OS_WINDOWS_MINGW    - MinGW
 | 
					//     GTEST_OS_WINDOWS_MINGW    - MinGW
 | 
				
			||||||
@ -175,7 +174,6 @@
 | 
				
			|||||||
//                            define themselves.
 | 
					//                            define themselves.
 | 
				
			||||||
//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
 | 
					//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
 | 
				
			||||||
//                            the above RE\b(s) are mutually exclusive.
 | 
					//                            the above RE\b(s) are mutually exclusive.
 | 
				
			||||||
//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Misc public macros
 | 
					// Misc public macros
 | 
				
			||||||
// ------------------
 | 
					// ------------------
 | 
				
			||||||
@ -206,7 +204,6 @@
 | 
				
			|||||||
//                            - synchronization primitives.
 | 
					//                            - synchronization primitives.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Template meta programming:
 | 
					// Template meta programming:
 | 
				
			||||||
//   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
 | 
					 | 
				
			||||||
//   IteratorTraits - partial implementation of std::iterator_traits, which
 | 
					//   IteratorTraits - partial implementation of std::iterator_traits, which
 | 
				
			||||||
//                    is not available in libCstd when compiled with Sun C++.
 | 
					//                    is not available in libCstd when compiled with Sun C++.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
@ -492,7 +489,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
 | 
				
			|||||||
#  endif
 | 
					#  endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
 | 
					// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
 | 
				
			||||||
# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
 | 
					# elif defined(__GNUC__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#  ifdef __GXX_RTTI
 | 
					#  ifdef __GXX_RTTI
 | 
				
			||||||
// When building against STLport with the Android NDK and with
 | 
					// When building against STLport with the Android NDK and with
 | 
				
			||||||
@ -595,12 +592,11 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
 | 
				
			|||||||
#ifndef GTEST_HAS_STREAM_REDIRECTION
 | 
					#ifndef GTEST_HAS_STREAM_REDIRECTION
 | 
				
			||||||
// By default, we assume that stream redirection is supported on all
 | 
					// By default, we assume that stream redirection is supported on all
 | 
				
			||||||
// platforms except known mobile ones.
 | 
					// platforms except known mobile ones.
 | 
				
			||||||
# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
 | 
					# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
 | 
				
			||||||
    GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
 | 
					 | 
				
			||||||
#  define GTEST_HAS_STREAM_REDIRECTION 0
 | 
					#  define GTEST_HAS_STREAM_REDIRECTION 0
 | 
				
			||||||
# else
 | 
					# else
 | 
				
			||||||
#  define GTEST_HAS_STREAM_REDIRECTION 1
 | 
					#  define GTEST_HAS_STREAM_REDIRECTION 1
 | 
				
			||||||
# endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
 | 
					# endif  // !GTEST_OS_WINDOWS_MOBILE
 | 
				
			||||||
#endif  // GTEST_HAS_STREAM_REDIRECTION
 | 
					#endif  // GTEST_HAS_STREAM_REDIRECTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Determines whether to support death tests.
 | 
					// Determines whether to support death tests.
 | 
				
			||||||
@ -626,8 +622,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Determines whether the system compiler uses UTF-16 for encoding wide strings.
 | 
					// Determines whether the system compiler uses UTF-16 for encoding wide strings.
 | 
				
			||||||
#define GTEST_WIDE_STRING_USES_UTF16_ \
 | 
					#define GTEST_WIDE_STRING_USES_UTF16_ \
 | 
				
			||||||
    (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || \
 | 
					  (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_AIX || GTEST_OS_OS2)
 | 
				
			||||||
     GTEST_OS_AIX || GTEST_OS_OS2)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Determines whether test results can be streamed to a socket.
 | 
					// Determines whether test results can be streamed to a socket.
 | 
				
			||||||
#if GTEST_OS_LINUX
 | 
					#if GTEST_OS_LINUX
 | 
				
			||||||
@ -706,11 +701,11 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
 | 
				
			|||||||
// following the argument list:
 | 
					// following the argument list:
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
 | 
					//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
 | 
				
			||||||
#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
 | 
					#if defined(__GNUC__) && !defined(COMPILER_ICC)
 | 
				
			||||||
# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
 | 
					# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
# define GTEST_MUST_USE_RESULT_
 | 
					# define GTEST_MUST_USE_RESULT_
 | 
				
			||||||
#endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
 | 
					#endif  // __GNUC__ && !COMPILER_ICC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// MS C++ compiler emits warning when a conditional expression is compile time
 | 
					// MS C++ compiler emits warning when a conditional expression is compile time
 | 
				
			||||||
// constant. In some contexts this warning is false positive and needs to be
 | 
					// constant. In some contexts this warning is false positive and needs to be
 | 
				
			||||||
@ -1960,29 +1955,6 @@ class GTEST_API_ ThreadLocal {
 | 
				
			|||||||
// we cannot detect it.
 | 
					// we cannot detect it.
 | 
				
			||||||
GTEST_API_ size_t GetThreadCount();
 | 
					GTEST_API_ size_t GetThreadCount();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Passing non-POD classes through ellipsis (...) crashes the ARM
 | 
					 | 
				
			||||||
// compiler and generates a warning in Sun Studio before 12u4. The Nokia Symbian
 | 
					 | 
				
			||||||
// and the IBM XL C/C++ compiler try to instantiate a copy constructor
 | 
					 | 
				
			||||||
// for objects passed through ellipsis (...), failing for uncopyable
 | 
					 | 
				
			||||||
// objects.  We define this to ensure that only POD is passed through
 | 
					 | 
				
			||||||
// ellipsis on these systems.
 | 
					 | 
				
			||||||
#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || \
 | 
					 | 
				
			||||||
     (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5130)
 | 
					 | 
				
			||||||
// We lose support for NULL detection where the compiler doesn't like
 | 
					 | 
				
			||||||
// passing non-POD classes through ellipsis (...).
 | 
					 | 
				
			||||||
# define GTEST_ELLIPSIS_NEEDS_POD_ 1
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
# define GTEST_CAN_COMPARE_NULL 1
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
 | 
					 | 
				
			||||||
// const T& and const T* in a function template.  These compilers
 | 
					 | 
				
			||||||
// _can_ decide between class template specializations for T and T*,
 | 
					 | 
				
			||||||
// so a tr1::type_traits-like is_pointer works.
 | 
					 | 
				
			||||||
#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
 | 
					 | 
				
			||||||
# define GTEST_NEEDS_IS_POINTER_ 1
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
template <bool bool_value>
 | 
					template <bool bool_value>
 | 
				
			||||||
struct bool_constant {
 | 
					struct bool_constant {
 | 
				
			||||||
  typedef bool_constant<bool_value> type;
 | 
					  typedef bool_constant<bool_value> type;
 | 
				
			||||||
@ -1999,13 +1971,6 @@ struct is_same : public false_type {};
 | 
				
			|||||||
template <typename T>
 | 
					template <typename T>
 | 
				
			||||||
struct is_same<T, T> : public true_type {};
 | 
					struct is_same<T, T> : public true_type {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
template <typename T>
 | 
					 | 
				
			||||||
struct is_pointer : public false_type {};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
template <typename T>
 | 
					 | 
				
			||||||
struct is_pointer<T*> : public true_type {};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
template <typename Iterator>
 | 
					template <typename Iterator>
 | 
				
			||||||
struct IteratorTraits {
 | 
					struct IteratorTraits {
 | 
				
			||||||
  typedef typename Iterator::value_type value_type;
 | 
					  typedef typename Iterator::value_type value_type;
 | 
				
			||||||
 | 
				
			|||||||
@ -38,9 +38,6 @@
 | 
				
			|||||||
#elif GTEST_OS_WINDOWS
 | 
					#elif GTEST_OS_WINDOWS
 | 
				
			||||||
# include <direct.h>
 | 
					# include <direct.h>
 | 
				
			||||||
# include <io.h>
 | 
					# include <io.h>
 | 
				
			||||||
#elif GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
// Symbian OpenC has PATH_MAX in sys/syslimits.h
 | 
					 | 
				
			||||||
# include <sys/syslimits.h>
 | 
					 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
# include <limits.h>
 | 
					# include <limits.h>
 | 
				
			||||||
# include <climits>  // Some Linux distributions define PATH_MAX here.
 | 
					# include <climits>  // Some Linux distributions define PATH_MAX here.
 | 
				
			||||||
 | 
				
			|||||||
@ -231,7 +231,7 @@ GTEST_API_ std::string CodePointToUtf8(UInt32 code_point);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Converts a wide string to a narrow string in UTF-8 encoding.
 | 
					// Converts a wide string to a narrow string in UTF-8 encoding.
 | 
				
			||||||
// The wide string is assumed to have the following encoding:
 | 
					// The wide string is assumed to have the following encoding:
 | 
				
			||||||
//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
 | 
					//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin)
 | 
				
			||||||
//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)
 | 
					//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)
 | 
				
			||||||
// Parameter str points to a null-terminated wide string.
 | 
					// Parameter str points to a null-terminated wide string.
 | 
				
			||||||
// Parameter num_chars may additionally limit the number
 | 
					// Parameter num_chars may additionally limit the number
 | 
				
			||||||
 | 
				
			|||||||
@ -68,10 +68,6 @@
 | 
				
			|||||||
# include <unistd.h>  // NOLINT
 | 
					# include <unistd.h>  // NOLINT
 | 
				
			||||||
# include <string>
 | 
					# include <string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
# define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
					 | 
				
			||||||
# include <sys/time.h>  // NOLINT
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#elif GTEST_OS_ZOS
 | 
					#elif GTEST_OS_ZOS
 | 
				
			||||||
# define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
					# define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
				
			||||||
# include <sys/time.h>  // NOLINT
 | 
					# include <sys/time.h>  // NOLINT
 | 
				
			||||||
@ -1827,7 +1823,7 @@ std::string CodePointToUtf8(UInt32 code_point) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// The following two functions only make sense if the system
 | 
					// The following two functions only make sense if the system
 | 
				
			||||||
// uses UTF-16 for wide string encoding. All supported systems
 | 
					// uses UTF-16 for wide string encoding. All supported systems
 | 
				
			||||||
// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.
 | 
					// with 16 bit wchar_t (Windows, Cygwin) do use UTF-16.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Determines if the arguments constitute UTF-16 surrogate pair
 | 
					// Determines if the arguments constitute UTF-16 surrogate pair
 | 
				
			||||||
// and thus should be combined into a single Unicode code point
 | 
					// and thus should be combined into a single Unicode code point
 | 
				
			||||||
@ -1850,7 +1846,7 @@ inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Converts a wide string to a narrow string in UTF-8 encoding.
 | 
					// Converts a wide string to a narrow string in UTF-8 encoding.
 | 
				
			||||||
// The wide string is assumed to have the following encoding:
 | 
					// The wide string is assumed to have the following encoding:
 | 
				
			||||||
//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
 | 
					//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin)
 | 
				
			||||||
//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)
 | 
					//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)
 | 
				
			||||||
// Parameter str points to a null-terminated wide string.
 | 
					// Parameter str points to a null-terminated wide string.
 | 
				
			||||||
// Parameter num_chars may additionally limit the number
 | 
					// Parameter num_chars may additionally limit the number
 | 
				
			||||||
@ -3034,15 +3030,14 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
 | 
				
			|||||||
  va_list args;
 | 
					  va_list args;
 | 
				
			||||||
  va_start(args, fmt);
 | 
					  va_start(args, fmt);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \
 | 
					#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS || GTEST_OS_IOS || \
 | 
				
			||||||
    GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
 | 
					    GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
 | 
				
			||||||
  const bool use_color = AlwaysFalse();
 | 
					  const bool use_color = AlwaysFalse();
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
  static const bool in_color_mode =
 | 
					  static const bool in_color_mode =
 | 
				
			||||||
      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
 | 
					      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
 | 
				
			||||||
  const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
 | 
					  const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
 | 
				
			||||||
#endif  // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
 | 
					#endif  // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS
 | 
				
			||||||
  // The '!= 0' comparison is necessary to satisfy MSVC 7.1.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (!use_color) {
 | 
					  if (!use_color) {
 | 
				
			||||||
    vprintf(fmt, args);
 | 
					    vprintf(fmt, args);
 | 
				
			||||||
@ -4723,8 +4718,7 @@ void UnitTest::AddTestPartResult(
 | 
				
			|||||||
#else
 | 
					#else
 | 
				
			||||||
      // Dereference nullptr through a volatile pointer to prevent the compiler
 | 
					      // Dereference nullptr through a volatile pointer to prevent the compiler
 | 
				
			||||||
      // from removing. We use this rather than abort() or __builtin_trap() for
 | 
					      // from removing. We use this rather than abort() or __builtin_trap() for
 | 
				
			||||||
      // portability: Symbian doesn't implement abort() well, and some debuggers
 | 
					      // portability: some debuggers don't correctly trap abort().
 | 
				
			||||||
      // don't correctly trap abort().
 | 
					 | 
				
			||||||
      *static_cast<volatile int*>(nullptr) = 1;
 | 
					      *static_cast<volatile int*>(nullptr) = 1;
 | 
				
			||||||
#endif  // GTEST_OS_WINDOWS
 | 
					#endif  // GTEST_OS_WINDOWS
 | 
				
			||||||
    } else if (GTEST_FLAG(throw_on_failure)) {
 | 
					    } else if (GTEST_FLAG(throw_on_failure)) {
 | 
				
			||||||
 | 
				
			|||||||
@ -511,8 +511,6 @@ TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsEpochStart) {
 | 
				
			|||||||
  EXPECT_EQ("1970-01-01T00:00:00", FormatEpochTimeInMillisAsIso8601(0));
 | 
					  EXPECT_EQ("1970-01-01T00:00:00", FormatEpochTimeInMillisAsIso8601(0));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GTEST_CAN_COMPARE_NULL
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# ifdef __BORLANDC__
 | 
					# ifdef __BORLANDC__
 | 
				
			||||||
// Silences warnings: "Condition is always true", "Unreachable code"
 | 
					// Silences warnings: "Condition is always true", "Unreachable code"
 | 
				
			||||||
#  pragma option push -w-ccc -w-rch
 | 
					#  pragma option push -w-ccc -w-rch
 | 
				
			||||||
@ -541,7 +539,6 @@ TEST(NullLiteralTest, IsFalseForNonNullLiterals) {
 | 
				
			|||||||
#  pragma option pop
 | 
					#  pragma option pop
 | 
				
			||||||
# endif
 | 
					# endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif  // GTEST_CAN_COMPARE_NULL
 | 
					 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Tests CodePointToUtf8().
 | 
					// Tests CodePointToUtf8().
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -586,7 +583,7 @@ TEST(CodePointToUtf8Test, CanEncode12To16Bits) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if !GTEST_WIDE_STRING_USES_UTF16_
 | 
					#if !GTEST_WIDE_STRING_USES_UTF16_
 | 
				
			||||||
// Tests in this group require a wchar_t to hold > 16 bits, and thus
 | 
					// Tests in this group require a wchar_t to hold > 16 bits, and thus
 | 
				
			||||||
// are skipped on Windows, Cygwin, and Symbian, where a wchar_t is
 | 
					// are skipped on Windows, and Cygwin, where a wchar_t is
 | 
				
			||||||
// 16-bit wide. This code may not compile on those systems.
 | 
					// 16-bit wide. This code may not compile on those systems.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests that Unicode code-points that have 17 to 21 bits are encoded
 | 
					// Tests that Unicode code-points that have 17 to 21 bits are encoded
 | 
				
			||||||
@ -2822,8 +2819,6 @@ TEST_F(FloatTest, LargeDiff) {
 | 
				
			|||||||
TEST_F(FloatTest, Infinity) {
 | 
					TEST_F(FloatTest, Infinity) {
 | 
				
			||||||
  EXPECT_FLOAT_EQ(values_.infinity, values_.close_to_infinity);
 | 
					  EXPECT_FLOAT_EQ(values_.infinity, values_.close_to_infinity);
 | 
				
			||||||
  EXPECT_FLOAT_EQ(-values_.infinity, -values_.close_to_infinity);
 | 
					  EXPECT_FLOAT_EQ(-values_.infinity, -values_.close_to_infinity);
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  // Nokia's STLport crashes if we try to output infinity or NaN.
 | 
					 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.infinity, -values_.infinity),
 | 
					  EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.infinity, -values_.infinity),
 | 
				
			||||||
                          "-values_.infinity");
 | 
					                          "-values_.infinity");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2831,14 +2826,10 @@ TEST_F(FloatTest, Infinity) {
 | 
				
			|||||||
  // are only 1 DLP apart.
 | 
					  // are only 1 DLP apart.
 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.infinity, values_.nan1),
 | 
					  EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.infinity, values_.nan1),
 | 
				
			||||||
                          "values_.nan1");
 | 
					                          "values_.nan1");
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests that comparing with NAN always returns false.
 | 
					// Tests that comparing with NAN always returns false.
 | 
				
			||||||
TEST_F(FloatTest, NaN) {
 | 
					TEST_F(FloatTest, NaN) {
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
// Nokia's STLport crashes if we try to output infinity or NaN.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // In C++Builder, names within local classes (such as used by
 | 
					  // In C++Builder, names within local classes (such as used by
 | 
				
			||||||
  // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
 | 
					  // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
 | 
				
			||||||
  // scoping class.  Use a static local alias as a workaround.
 | 
					  // scoping class.  Use a static local alias as a workaround.
 | 
				
			||||||
@ -2856,7 +2847,6 @@ TEST_F(FloatTest, NaN) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(v.nan1, v.infinity),
 | 
					  EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(v.nan1, v.infinity),
 | 
				
			||||||
                       "v.infinity");
 | 
					                       "v.infinity");
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests that *_FLOAT_EQ are reflexive.
 | 
					// Tests that *_FLOAT_EQ are reflexive.
 | 
				
			||||||
@ -2918,10 +2908,6 @@ TEST_F(FloatTest, FloatLEFails) {
 | 
				
			|||||||
    EXPECT_PRED_FORMAT2(FloatLE, values_.further_from_one, 1.0f);
 | 
					    EXPECT_PRED_FORMAT2(FloatLE, values_.further_from_one, 1.0f);
 | 
				
			||||||
  }, "(values_.further_from_one) <= (1.0f)");
 | 
					  }, "(values_.further_from_one) <= (1.0f)");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN && !defined(__BORLANDC__)
 | 
					 | 
				
			||||||
  // Nokia's STLport crashes if we try to output infinity or NaN.
 | 
					 | 
				
			||||||
  // C++Builder gives bad results for ordered comparisons involving NaNs
 | 
					 | 
				
			||||||
  // due to compiler bugs.
 | 
					 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE({  // NOLINT
 | 
					  EXPECT_NONFATAL_FAILURE({  // NOLINT
 | 
				
			||||||
    EXPECT_PRED_FORMAT2(FloatLE, values_.nan1, values_.infinity);
 | 
					    EXPECT_PRED_FORMAT2(FloatLE, values_.nan1, values_.infinity);
 | 
				
			||||||
  }, "(values_.nan1) <= (values_.infinity)");
 | 
					  }, "(values_.nan1) <= (values_.infinity)");
 | 
				
			||||||
@ -2931,7 +2917,6 @@ TEST_F(FloatTest, FloatLEFails) {
 | 
				
			|||||||
  EXPECT_FATAL_FAILURE({  // NOLINT
 | 
					  EXPECT_FATAL_FAILURE({  // NOLINT
 | 
				
			||||||
    ASSERT_PRED_FORMAT2(FloatLE, values_.nan1, values_.nan1);
 | 
					    ASSERT_PRED_FORMAT2(FloatLE, values_.nan1, values_.nan1);
 | 
				
			||||||
  }, "(values_.nan1) <= (values_.nan1)");
 | 
					  }, "(values_.nan1) <= (values_.nan1)");
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN && !defined(__BORLANDC__)
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Instantiates FloatingPointTest for testing *_DOUBLE_EQ.
 | 
					// Instantiates FloatingPointTest for testing *_DOUBLE_EQ.
 | 
				
			||||||
@ -2995,8 +2980,6 @@ TEST_F(DoubleTest, LargeDiff) {
 | 
				
			|||||||
TEST_F(DoubleTest, Infinity) {
 | 
					TEST_F(DoubleTest, Infinity) {
 | 
				
			||||||
  EXPECT_DOUBLE_EQ(values_.infinity, values_.close_to_infinity);
 | 
					  EXPECT_DOUBLE_EQ(values_.infinity, values_.close_to_infinity);
 | 
				
			||||||
  EXPECT_DOUBLE_EQ(-values_.infinity, -values_.close_to_infinity);
 | 
					  EXPECT_DOUBLE_EQ(-values_.infinity, -values_.close_to_infinity);
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  // Nokia's STLport crashes if we try to output infinity or NaN.
 | 
					 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, -values_.infinity),
 | 
					  EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, -values_.infinity),
 | 
				
			||||||
                          "-values_.infinity");
 | 
					                          "-values_.infinity");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -3004,18 +2987,10 @@ TEST_F(DoubleTest, Infinity) {
 | 
				
			|||||||
  // are only 1 DLP apart.
 | 
					  // are only 1 DLP apart.
 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, values_.nan1),
 | 
					  EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, values_.nan1),
 | 
				
			||||||
                          "values_.nan1");
 | 
					                          "values_.nan1");
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests that comparing with NAN always returns false.
 | 
					// Tests that comparing with NAN always returns false.
 | 
				
			||||||
TEST_F(DoubleTest, NaN) {
 | 
					TEST_F(DoubleTest, NaN) {
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  // In C++Builder, names within local classes (such as used by
 | 
					 | 
				
			||||||
  // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
 | 
					 | 
				
			||||||
  // scoping class.  Use a static local alias as a workaround.
 | 
					 | 
				
			||||||
  // We use the assignment syntax since some compilers, like Sun Studio,
 | 
					 | 
				
			||||||
  // don't allow initializing references using construction syntax
 | 
					 | 
				
			||||||
  // (parentheses).
 | 
					 | 
				
			||||||
  static const DoubleTest::TestValues& v = this->values_;
 | 
					  static const DoubleTest::TestValues& v = this->values_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Nokia's STLport crashes if we try to output infinity or NaN.
 | 
					  // Nokia's STLport crashes if we try to output infinity or NaN.
 | 
				
			||||||
@ -3025,17 +3000,13 @@ TEST_F(DoubleTest, NaN) {
 | 
				
			|||||||
  EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(1.0, v.nan1), "v.nan1");
 | 
					  EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(1.0, v.nan1), "v.nan1");
 | 
				
			||||||
  EXPECT_FATAL_FAILURE(ASSERT_DOUBLE_EQ(v.nan1, v.infinity),
 | 
					  EXPECT_FATAL_FAILURE(ASSERT_DOUBLE_EQ(v.nan1, v.infinity),
 | 
				
			||||||
                       "v.infinity");
 | 
					                       "v.infinity");
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests that *_DOUBLE_EQ are reflexive.
 | 
					// Tests that *_DOUBLE_EQ are reflexive.
 | 
				
			||||||
TEST_F(DoubleTest, Reflexive) {
 | 
					TEST_F(DoubleTest, Reflexive) {
 | 
				
			||||||
  EXPECT_DOUBLE_EQ(0.0, 0.0);
 | 
					  EXPECT_DOUBLE_EQ(0.0, 0.0);
 | 
				
			||||||
  EXPECT_DOUBLE_EQ(1.0, 1.0);
 | 
					  EXPECT_DOUBLE_EQ(1.0, 1.0);
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
  // Nokia's STLport crashes if we try to output infinity or NaN.
 | 
					 | 
				
			||||||
  ASSERT_DOUBLE_EQ(values_.infinity, values_.infinity);
 | 
					  ASSERT_DOUBLE_EQ(values_.infinity, values_.infinity);
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests that *_DOUBLE_EQ are commutative.
 | 
					// Tests that *_DOUBLE_EQ are commutative.
 | 
				
			||||||
@ -3090,10 +3061,6 @@ TEST_F(DoubleTest, DoubleLEFails) {
 | 
				
			|||||||
    EXPECT_PRED_FORMAT2(DoubleLE, values_.further_from_one, 1.0);
 | 
					    EXPECT_PRED_FORMAT2(DoubleLE, values_.further_from_one, 1.0);
 | 
				
			||||||
  }, "(values_.further_from_one) <= (1.0)");
 | 
					  }, "(values_.further_from_one) <= (1.0)");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !GTEST_OS_SYMBIAN && !defined(__BORLANDC__)
 | 
					 | 
				
			||||||
  // Nokia's STLport crashes if we try to output infinity or NaN.
 | 
					 | 
				
			||||||
  // C++Builder gives bad results for ordered comparisons involving NaNs
 | 
					 | 
				
			||||||
  // due to compiler bugs.
 | 
					 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE({  // NOLINT
 | 
					  EXPECT_NONFATAL_FAILURE({  // NOLINT
 | 
				
			||||||
    EXPECT_PRED_FORMAT2(DoubleLE, values_.nan1, values_.infinity);
 | 
					    EXPECT_PRED_FORMAT2(DoubleLE, values_.nan1, values_.infinity);
 | 
				
			||||||
  }, "(values_.nan1) <= (values_.infinity)");
 | 
					  }, "(values_.nan1) <= (values_.infinity)");
 | 
				
			||||||
@ -3103,7 +3070,6 @@ TEST_F(DoubleTest, DoubleLEFails) {
 | 
				
			|||||||
  EXPECT_FATAL_FAILURE({  // NOLINT
 | 
					  EXPECT_FATAL_FAILURE({  // NOLINT
 | 
				
			||||||
    ASSERT_PRED_FORMAT2(DoubleLE, values_.nan1, values_.nan1);
 | 
					    ASSERT_PRED_FORMAT2(DoubleLE, values_.nan1, values_.nan1);
 | 
				
			||||||
  }, "(values_.nan1) <= (values_.nan1)");
 | 
					  }, "(values_.nan1) <= (values_.nan1)");
 | 
				
			||||||
#endif  // !GTEST_OS_SYMBIAN && !defined(__BORLANDC__)
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -3711,7 +3677,6 @@ TEST(AssertionTest, ASSERT_EQ) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests ASSERT_EQ(NULL, pointer).
 | 
					// Tests ASSERT_EQ(NULL, pointer).
 | 
				
			||||||
#if GTEST_CAN_COMPARE_NULL
 | 
					 | 
				
			||||||
TEST(AssertionTest, ASSERT_EQ_NULL) {
 | 
					TEST(AssertionTest, ASSERT_EQ_NULL) {
 | 
				
			||||||
  // A success.
 | 
					  // A success.
 | 
				
			||||||
  const char* p = nullptr;
 | 
					  const char* p = nullptr;
 | 
				
			||||||
@ -3725,7 +3690,6 @@ TEST(AssertionTest, ASSERT_EQ_NULL) {
 | 
				
			|||||||
  static int n = 0;
 | 
					  static int n = 0;
 | 
				
			||||||
  EXPECT_FATAL_FAILURE(ASSERT_EQ(nullptr, &n), "  &n\n    Which is:");
 | 
					  EXPECT_FATAL_FAILURE(ASSERT_EQ(nullptr, &n), "  &n\n    Which is:");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif  // GTEST_CAN_COMPARE_NULL
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests ASSERT_EQ(0, non_pointer).  Since the literal 0 can be
 | 
					// Tests ASSERT_EQ(0, non_pointer).  Since the literal 0 can be
 | 
				
			||||||
// treated as a null pointer by the compiler, we need to make sure
 | 
					// treated as a null pointer by the compiler, we need to make sure
 | 
				
			||||||
@ -3916,11 +3880,8 @@ TEST(AssertionTest, NamedEnum) {
 | 
				
			|||||||
  EXPECT_NONFATAL_FAILURE(EXPECT_EQ(kE1, kE2), "Which is: 1");
 | 
					  EXPECT_NONFATAL_FAILURE(EXPECT_EQ(kE1, kE2), "Which is: 1");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// The version of gcc used in XCode 2.2 has a bug and doesn't allow
 | 
					// Sun Studio and HP aCC2reject this code.
 | 
				
			||||||
// anonymous enums in assertions.  Therefore the following test is not
 | 
					#if !defined(__SUNPRO_CC) && !defined(__HP_aCC)
 | 
				
			||||||
// done on Mac.
 | 
					 | 
				
			||||||
// Sun Studio and HP aCC also reject this code.
 | 
					 | 
				
			||||||
#if !GTEST_OS_MAC && !defined(__SUNPRO_CC) && !defined(__HP_aCC)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests using assertions with anonymous enums.
 | 
					// Tests using assertions with anonymous enums.
 | 
				
			||||||
enum {
 | 
					enum {
 | 
				
			||||||
@ -4439,7 +4400,6 @@ TEST(ExpectTest, EXPECT_EQ_Double) {
 | 
				
			|||||||
                          "5.1");
 | 
					                          "5.1");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GTEST_CAN_COMPARE_NULL
 | 
					 | 
				
			||||||
// Tests EXPECT_EQ(NULL, pointer).
 | 
					// Tests EXPECT_EQ(NULL, pointer).
 | 
				
			||||||
TEST(ExpectTest, EXPECT_EQ_NULL) {
 | 
					TEST(ExpectTest, EXPECT_EQ_NULL) {
 | 
				
			||||||
  // A success.
 | 
					  // A success.
 | 
				
			||||||
@ -4454,7 +4414,6 @@ TEST(ExpectTest, EXPECT_EQ_NULL) {
 | 
				
			|||||||
  int n = 0;
 | 
					  int n = 0;
 | 
				
			||||||
  EXPECT_NONFATAL_FAILURE(EXPECT_EQ(nullptr, &n), "  &n\n    Which is:");
 | 
					  EXPECT_NONFATAL_FAILURE(EXPECT_EQ(nullptr, &n), "  &n\n    Which is:");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif  // GTEST_CAN_COMPARE_NULL
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests EXPECT_EQ(0, non_pointer).  Since the literal 0 can be
 | 
					// Tests EXPECT_EQ(0, non_pointer).  Since the literal 0 can be
 | 
				
			||||||
// treated as a null pointer by the compiler, we need to make sure
 | 
					// treated as a null pointer by the compiler, we need to make sure
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user