Googletest export
Internal Change PiperOrigin-RevId: 227575279
This commit is contained in:
		@@ -382,8 +382,6 @@ class TuplePrefix {
 | 
				
			|||||||
    const Value& value = std::get<N - 1>(values);
 | 
					    const Value& value = std::get<N - 1>(values);
 | 
				
			||||||
    StringMatchResultListener listener;
 | 
					    StringMatchResultListener listener;
 | 
				
			||||||
    if (!matcher.MatchAndExplain(value, &listener)) {
 | 
					    if (!matcher.MatchAndExplain(value, &listener)) {
 | 
				
			||||||
      // FIXME: include in the message the name of the parameter
 | 
					 | 
				
			||||||
      // as used in MOCK_METHOD*() when possible.
 | 
					 | 
				
			||||||
      *os << "  Expected arg #" << N - 1 << ": ";
 | 
					      *os << "  Expected arg #" << N - 1 << ": ";
 | 
				
			||||||
      std::get<N - 1>(matchers).DescribeTo(os);
 | 
					      std::get<N - 1>(matchers).DescribeTo(os);
 | 
				
			||||||
      *os << "\n           Actual: ";
 | 
					      *os << "\n           Actual: ";
 | 
				
			||||||
@@ -1657,7 +1655,6 @@ class WhenDynamicCastToMatcher : public WhenDynamicCastToMatcherBase<To> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  template <typename From>
 | 
					  template <typename From>
 | 
				
			||||||
  bool MatchAndExplain(From from, MatchResultListener* listener) const {
 | 
					  bool MatchAndExplain(From from, MatchResultListener* listener) const {
 | 
				
			||||||
    // FIXME: Add more detail on failures. ie did the dyn_cast fail?
 | 
					 | 
				
			||||||
    To to = dynamic_cast<To>(from);
 | 
					    To to = dynamic_cast<To>(from);
 | 
				
			||||||
    return MatchPrintAndExplain(to, this->matcher_, listener);
 | 
					    return MatchPrintAndExplain(to, this->matcher_, listener);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -186,7 +186,6 @@ class GTEST_API_ UntypedFunctionMockerBase {
 | 
				
			|||||||
  // this information in the global mock registry.  Will be called
 | 
					  // this information in the global mock registry.  Will be called
 | 
				
			||||||
  // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
 | 
					  // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
 | 
				
			||||||
  // method.
 | 
					  // method.
 | 
				
			||||||
  // FIXME: rename to SetAndRegisterOwner().
 | 
					 | 
				
			||||||
  void RegisterOwner(const void* mock_obj)
 | 
					  void RegisterOwner(const void* mock_obj)
 | 
				
			||||||
      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
 | 
					      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1197,9 +1196,6 @@ class TypedExpectation : public ExpectationBase {
 | 
				
			|||||||
      mocker->DescribeDefaultActionTo(args, what);
 | 
					      mocker->DescribeDefaultActionTo(args, what);
 | 
				
			||||||
      DescribeCallCountTo(why);
 | 
					      DescribeCallCountTo(why);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // FIXME: allow the user to control whether
 | 
					 | 
				
			||||||
      // unexpected calls should fail immediately or continue using a
 | 
					 | 
				
			||||||
      // flag --gmock_unexpected_calls_are_fatal.
 | 
					 | 
				
			||||||
      return nullptr;
 | 
					      return nullptr;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -346,8 +346,6 @@ class WithoutMatchers {
 | 
				
			|||||||
// Internal use only: access the singleton instance of WithoutMatchers.
 | 
					// Internal use only: access the singleton instance of WithoutMatchers.
 | 
				
			||||||
GTEST_API_ WithoutMatchers GetWithoutMatchers();
 | 
					GTEST_API_ WithoutMatchers GetWithoutMatchers();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FIXME: group all type utilities together.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Type traits.
 | 
					// Type traits.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// is_reference<T>::value is non-zero iff T is a reference type.
 | 
					// is_reference<T>::value is non-zero iff T is a reference type.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -790,9 +790,6 @@ void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,
 | 
				
			|||||||
    const TestInfo* const test_info =
 | 
					    const TestInfo* const test_info =
 | 
				
			||||||
        UnitTest::GetInstance()->current_test_info();
 | 
					        UnitTest::GetInstance()->current_test_info();
 | 
				
			||||||
    if (test_info != nullptr) {
 | 
					    if (test_info != nullptr) {
 | 
				
			||||||
      // FIXME: record the test case name when the
 | 
					 | 
				
			||||||
      // ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or
 | 
					 | 
				
			||||||
      // TearDownTestCase().
 | 
					 | 
				
			||||||
      state.first_used_test_case = test_info->test_case_name();
 | 
					      state.first_used_test_case = test_info->test_case_name();
 | 
				
			||||||
      state.first_used_test = test_info->name();
 | 
					      state.first_used_test = test_info->name();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,9 +33,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace testing {
 | 
					namespace testing {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FIXME: support using environment variables to
 | 
					 | 
				
			||||||
// control the flag values, like what Google Test does.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
GMOCK_DEFINE_bool_(catch_leaked_mocks, true,
 | 
					GMOCK_DEFINE_bool_(catch_leaked_mocks, true,
 | 
				
			||||||
                   "true iff Google Mock should report leaked mock objects "
 | 
					                   "true iff Google Mock should report leaked mock objects "
 | 
				
			||||||
                   "as failures.");
 | 
					                   "as failures.");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1438,10 +1438,6 @@ TEST(FunctorActionTest, UnusedArguments) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Test that basic built-in actions work with move-only arguments.
 | 
					// Test that basic built-in actions work with move-only arguments.
 | 
				
			||||||
// FIXME: Currently, almost all ActionInterface-based actions will not
 | 
					 | 
				
			||||||
// work, even if they only try to use other, copyable arguments. Implement them
 | 
					 | 
				
			||||||
// if necessary (but note that DoAll cannot work on non-copyable types anyway -
 | 
					 | 
				
			||||||
// so maybe it's better to make users use lambdas instead.
 | 
					 | 
				
			||||||
TEST(MoveOnlyArgumentsTest, ReturningActions) {
 | 
					TEST(MoveOnlyArgumentsTest, ReturningActions) {
 | 
				
			||||||
  Action<int(std::unique_ptr<int>)> a = Return(1);
 | 
					  Action<int(std::unique_ptr<int>)> a = Return(1);
 | 
				
			||||||
  EXPECT_EQ(1, a.Perform(std::make_tuple(nullptr)));
 | 
					  EXPECT_EQ(1, a.Perform(std::make_tuple(nullptr)));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -161,7 +161,6 @@ GTEST_API_ bool InDeathTestChild();
 | 
				
			|||||||
//   is rarely a problem as people usually don't put the test binary
 | 
					//   is rarely a problem as people usually don't put the test binary
 | 
				
			||||||
//   directory in PATH.
 | 
					//   directory in PATH.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// FIXME: make thread-safe death tests search the PATH.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Asserts that a given statement causes the program to exit, with an
 | 
					// Asserts that a given statement causes the program to exit, with an
 | 
				
			||||||
// integer exit status that satisfies predicate, and emitting error output
 | 
					// integer exit status that satisfies predicate, and emitting error output
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,10 +69,6 @@ namespace testing {
 | 
				
			|||||||
// MatchResultListener is an abstract class.  Its << operator can be
 | 
					// MatchResultListener is an abstract class.  Its << operator can be
 | 
				
			||||||
// used by a matcher to explain why a value matches or doesn't match.
 | 
					// used by a matcher to explain why a value matches or doesn't match.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// FIXME: add method
 | 
					 | 
				
			||||||
//   bool InterestedInWhy(bool result) const;
 | 
					 | 
				
			||||||
// to indicate whether the listener is interested in why the match
 | 
					 | 
				
			||||||
// result is 'result'.
 | 
					 | 
				
			||||||
class MatchResultListener {
 | 
					class MatchResultListener {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
  // Creates a listener object with the given underlying ostream.  The
 | 
					  // Creates a listener object with the given underlying ostream.  The
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -761,7 +761,6 @@ void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
 | 
				
			|||||||
    // If the array has more than kThreshold elements, we'll have to
 | 
					    // If the array has more than kThreshold elements, we'll have to
 | 
				
			||||||
    // omit some details by printing only the first and the last
 | 
					    // omit some details by printing only the first and the last
 | 
				
			||||||
    // kChunkSize elements.
 | 
					    // kChunkSize elements.
 | 
				
			||||||
    // FIXME: let the user control the threshold using a flag.
 | 
					 | 
				
			||||||
    if (len <= kThreshold) {
 | 
					    if (len <= kThreshold) {
 | 
				
			||||||
      PrintRawArrayTo(begin, len, os);
 | 
					      PrintRawArrayTo(begin, len, os);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -329,7 +329,6 @@ class GTEST_API_ AssertionResult {
 | 
				
			|||||||
  const char* message() const {
 | 
					  const char* message() const {
 | 
				
			||||||
    return message_.get() != nullptr ? message_->c_str() : "";
 | 
					    return message_.get() != nullptr ? message_->c_str() : "";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  // FIXME: Remove this after making sure no clients use it.
 | 
					 | 
				
			||||||
  // Deprecated; please use message() instead.
 | 
					  // Deprecated; please use message() instead.
 | 
				
			||||||
  const char* failure_message() const { return message(); }
 | 
					  const char* failure_message() const { return message(); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -457,9 +457,6 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
 | 
				
			|||||||
#ifndef GTEST_HAS_STD_WSTRING
 | 
					#ifndef GTEST_HAS_STD_WSTRING
 | 
				
			||||||
// The user didn't tell us whether ::std::wstring is available, so we need
 | 
					// The user didn't tell us whether ::std::wstring is available, so we need
 | 
				
			||||||
// to figure it out.
 | 
					// to figure it out.
 | 
				
			||||||
// FIXME: uses autoconf to detect whether ::std::wstring
 | 
					 | 
				
			||||||
//   is available.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Cygwin 1.7 and below doesn't support ::std::wstring.
 | 
					// Cygwin 1.7 and below doesn't support ::std::wstring.
 | 
				
			||||||
// Solaris' libc++ doesn't support it either.  Android has
 | 
					// Solaris' libc++ doesn't support it either.  Android has
 | 
				
			||||||
// no support for it at least as recent as Froyo (2.2).
 | 
					// no support for it at least as recent as Froyo (2.2).
 | 
				
			||||||
@@ -926,9 +923,6 @@ class GTEST_API_ RE {
 | 
				
			|||||||
  // the entire str.
 | 
					  // the entire str.
 | 
				
			||||||
  // PartialMatch(str, re) returns true iff regular expression re
 | 
					  // PartialMatch(str, re) returns true iff regular expression re
 | 
				
			||||||
  // matches a substring of str (including str itself).
 | 
					  // matches a substring of str (including str itself).
 | 
				
			||||||
  //
 | 
					 | 
				
			||||||
  // FIXME: make FullMatch() and PartialMatch() work
 | 
					 | 
				
			||||||
  // when str contains NUL characters.
 | 
					 | 
				
			||||||
  static bool FullMatch(const ::std::string& str, const RE& re) {
 | 
					  static bool FullMatch(const ::std::string& str, const RE& re) {
 | 
				
			||||||
    return FullMatch(str.c_str(), re);
 | 
					    return FullMatch(str.c_str(), re);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -952,10 +946,6 @@ class GTEST_API_ RE {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
  void Init(const char* regex);
 | 
					  void Init(const char* regex);
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // We use a const char* instead of an std::string, as Google Test used to be
 | 
					 | 
				
			||||||
  // used where std::string is not available.  FIXME: change to
 | 
					 | 
				
			||||||
  // std::string.
 | 
					 | 
				
			||||||
  const char* pattern_;
 | 
					  const char* pattern_;
 | 
				
			||||||
  bool is_valid_;
 | 
					  bool is_valid_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -2293,9 +2283,6 @@ typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
 | 
				
			|||||||
// Parses 'str' for a 32-bit signed integer.  If successful, writes the result
 | 
					// Parses 'str' for a 32-bit signed integer.  If successful, writes the result
 | 
				
			||||||
// to *value and returns true; otherwise leaves *value unchanged and returns
 | 
					// to *value and returns true; otherwise leaves *value unchanged and returns
 | 
				
			||||||
// false.
 | 
					// false.
 | 
				
			||||||
// FIXME: Find a better way to refactor flag and environment parsing
 | 
					 | 
				
			||||||
// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
 | 
					 | 
				
			||||||
// function.
 | 
					 | 
				
			||||||
bool ParseInt32(const Message& src_text, const char* str, Int32* value);
 | 
					bool ParseInt32(const Message& src_text, const char* str, Int32* value);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Parses a bool/Int32/string from the environment variable
 | 
					// Parses a bool/Int32/string from the environment variable
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -274,8 +274,6 @@ static const int kFuchsiaReadPipeFd = 3;
 | 
				
			|||||||
// statement, which is not allowed; THREW means that the test statement
 | 
					// statement, which is not allowed; THREW means that the test statement
 | 
				
			||||||
// returned control by throwing an exception.  IN_PROGRESS means the test
 | 
					// returned control by throwing an exception.  IN_PROGRESS means the test
 | 
				
			||||||
// has not yet concluded.
 | 
					// has not yet concluded.
 | 
				
			||||||
// FIXME: Unify names and possibly values for
 | 
					 | 
				
			||||||
// AbortReason, DeathTestOutcome, and flag characters above.
 | 
					 | 
				
			||||||
enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
 | 
					enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Routine for aborting the program which is safe to call from an
 | 
					// Routine for aborting the program which is safe to call from an
 | 
				
			||||||
@@ -1523,8 +1521,6 @@ static int GetStatusFileDescriptor(unsigned int parent_process_id,
 | 
				
			|||||||
                   StreamableToString(parent_process_id));
 | 
					                   StreamableToString(parent_process_id));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // FIXME: Replace the following check with a
 | 
					 | 
				
			||||||
  // compile-time assertion when available.
 | 
					 | 
				
			||||||
  GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
 | 
					  GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const HANDLE write_handle =
 | 
					  const HANDLE write_handle =
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -247,9 +247,6 @@ bool FilePath::DirectoryExists() const {
 | 
				
			|||||||
// root directory per disk drive.)
 | 
					// root directory per disk drive.)
 | 
				
			||||||
bool FilePath::IsRootDirectory() const {
 | 
					bool FilePath::IsRootDirectory() const {
 | 
				
			||||||
#if GTEST_OS_WINDOWS
 | 
					#if GTEST_OS_WINDOWS
 | 
				
			||||||
  // FIXME: on Windows a network share like
 | 
					 | 
				
			||||||
  // \\server\share can be a root directory, although it cannot be the
 | 
					 | 
				
			||||||
  // current directory.  Handle this properly.
 | 
					 | 
				
			||||||
  return pathname_.length() == 3 && IsAbsolutePath();
 | 
					  return pathname_.length() == 3 && IsAbsolutePath();
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
  return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
 | 
					  return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
 | 
				
			||||||
@@ -347,7 +344,6 @@ FilePath FilePath::RemoveTrailingPathSeparator() const {
 | 
				
			|||||||
// Removes any redundant separators that might be in the pathname.
 | 
					// Removes any redundant separators that might be in the pathname.
 | 
				
			||||||
// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
 | 
					// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
 | 
				
			||||||
// redundancies that might be in a pathname involving "." or "..".
 | 
					// redundancies that might be in a pathname involving "." or "..".
 | 
				
			||||||
// FIXME: handle Windows network shares (e.g. \\server\share).
 | 
					 | 
				
			||||||
void FilePath::Normalize() {
 | 
					void FilePath::Normalize() {
 | 
				
			||||||
  if (pathname_.c_str() == nullptr) {
 | 
					  if (pathname_.c_str() == nullptr) {
 | 
				
			||||||
    pathname_ = "";
 | 
					    pathname_ = "";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -998,8 +998,6 @@ bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const bool parse_success = *end == '\0' && errno == 0;
 | 
					  const bool parse_success = *end == '\0' && errno == 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // FIXME: Convert this to compile time assertion when it is
 | 
					 | 
				
			||||||
  // available.
 | 
					 | 
				
			||||||
  GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
 | 
					  GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const Integer result = static_cast<Integer>(parsed);
 | 
					  const Integer result = static_cast<Integer>(parsed);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -265,9 +265,6 @@ Mutex::Mutex()
 | 
				
			|||||||
Mutex::~Mutex() {
 | 
					Mutex::~Mutex() {
 | 
				
			||||||
  // Static mutexes are leaked intentionally. It is not thread-safe to try
 | 
					  // Static mutexes are leaked intentionally. It is not thread-safe to try
 | 
				
			||||||
  // to clean them up.
 | 
					  // to clean them up.
 | 
				
			||||||
  // FIXME: Switch to Slim Reader/Writer (SRW) Locks, which requires
 | 
					 | 
				
			||||||
  // nothing to clean it up but is available only on Vista and later.
 | 
					 | 
				
			||||||
  // https://docs.microsoft.com/en-us/windows/desktop/Sync/slim-reader-writer--srw--locks
 | 
					 | 
				
			||||||
  if (type_ == kDynamic) {
 | 
					  if (type_ == kDynamic) {
 | 
				
			||||||
    ::DeleteCriticalSection(critical_section_);
 | 
					    ::DeleteCriticalSection(critical_section_);
 | 
				
			||||||
    delete critical_section_;
 | 
					    delete critical_section_;
 | 
				
			||||||
@@ -388,7 +385,6 @@ class ThreadWithParamSupport : public ThreadWithParamBase {
 | 
				
			|||||||
                             Notification* thread_can_start) {
 | 
					                             Notification* thread_can_start) {
 | 
				
			||||||
    ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
 | 
					    ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
 | 
				
			||||||
    DWORD thread_id;
 | 
					    DWORD thread_id;
 | 
				
			||||||
    // FIXME: Consider to use _beginthreadex instead.
 | 
					 | 
				
			||||||
    HANDLE thread_handle = ::CreateThread(
 | 
					    HANDLE thread_handle = ::CreateThread(
 | 
				
			||||||
        nullptr,  // Default security.
 | 
					        nullptr,  // Default security.
 | 
				
			||||||
        0,        // Default stack size.
 | 
					        0,        // Default stack size.
 | 
				
			||||||
@@ -741,9 +737,6 @@ static std::string FormatRegexSyntaxError(const char* regex, int index) {
 | 
				
			|||||||
// otherwise returns true.
 | 
					// otherwise returns true.
 | 
				
			||||||
bool ValidateRegex(const char* regex) {
 | 
					bool ValidateRegex(const char* regex) {
 | 
				
			||||||
  if (regex == nullptr) {
 | 
					  if (regex == nullptr) {
 | 
				
			||||||
    // FIXME: fix the source file location in the
 | 
					 | 
				
			||||||
    // assertion failures to match where the regex is used in user
 | 
					 | 
				
			||||||
    // code.
 | 
					 | 
				
			||||||
    ADD_FAILURE() << "NULL is not a valid simple regular expression.";
 | 
					    ADD_FAILURE() << "NULL is not a valid simple regular expression.";
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -89,7 +89,6 @@ void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,
 | 
				
			|||||||
  // If the object size is bigger than kThreshold, we'll have to omit
 | 
					  // If the object size is bigger than kThreshold, we'll have to omit
 | 
				
			||||||
  // some details by printing only the first and the last kChunkSize
 | 
					  // some details by printing only the first and the last kChunkSize
 | 
				
			||||||
  // bytes.
 | 
					  // bytes.
 | 
				
			||||||
  // FIXME: let the user control the threshold using a flag.
 | 
					 | 
				
			||||||
  if (count < kThreshold) {
 | 
					  if (count < kThreshold) {
 | 
				
			||||||
    PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);
 | 
					    PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,8 +54,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if GTEST_OS_LINUX
 | 
					#if GTEST_OS_LINUX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FIXME: Use autoconf to detect availability of
 | 
					 | 
				
			||||||
// gettimeofday().
 | 
					 | 
				
			||||||
# define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
					# define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# include <fcntl.h>  // NOLINT
 | 
					# include <fcntl.h>  // NOLINT
 | 
				
			||||||
@@ -89,11 +87,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# if GTEST_OS_WINDOWS_MINGW
 | 
					# if GTEST_OS_WINDOWS_MINGW
 | 
				
			||||||
// MinGW has gettimeofday() but not _ftime64().
 | 
					// MinGW has gettimeofday() but not _ftime64().
 | 
				
			||||||
// FIXME: Use autoconf to detect availability of
 | 
					 | 
				
			||||||
//   gettimeofday().
 | 
					 | 
				
			||||||
// FIXME: There are other ways to get the time on
 | 
					 | 
				
			||||||
//   Windows, like GetTickCount() or GetSystemTimeAsFileTime().  MinGW
 | 
					 | 
				
			||||||
//   supports these.  consider using them instead.
 | 
					 | 
				
			||||||
#  define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
					#  define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
				
			||||||
#  include <sys/time.h>  // NOLINT
 | 
					#  include <sys/time.h>  // NOLINT
 | 
				
			||||||
# endif  // GTEST_OS_WINDOWS_MINGW
 | 
					# endif  // GTEST_OS_WINDOWS_MINGW
 | 
				
			||||||
@@ -106,8 +99,6 @@
 | 
				
			|||||||
#else
 | 
					#else
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Assume other platforms have gettimeofday().
 | 
					// Assume other platforms have gettimeofday().
 | 
				
			||||||
// FIXME: Use autoconf to detect availability of
 | 
					 | 
				
			||||||
//   gettimeofday().
 | 
					 | 
				
			||||||
# define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
					# define GTEST_HAS_GETTIMEOFDAY_ 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// cpplint thinks that the header is already included, so we want to
 | 
					// cpplint thinks that the header is already included, so we want to
 | 
				
			||||||
@@ -477,10 +468,6 @@ std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  internal::FilePath output_name(colon + 1);
 | 
					  internal::FilePath output_name(colon + 1);
 | 
				
			||||||
  if (!output_name.IsAbsolutePath())
 | 
					  if (!output_name.IsAbsolutePath())
 | 
				
			||||||
    // FIXME: on Windows \some\path is not an absolute
 | 
					 | 
				
			||||||
    // path (as its meaning depends on the current drive), yet the
 | 
					 | 
				
			||||||
    // following logic for turning it into an absolute path is wrong.
 | 
					 | 
				
			||||||
    // Fix it.
 | 
					 | 
				
			||||||
    output_name = internal::FilePath::ConcatPaths(
 | 
					    output_name = internal::FilePath::ConcatPaths(
 | 
				
			||||||
        internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
 | 
					        internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
 | 
				
			||||||
        internal::FilePath(colon + 1));
 | 
					        internal::FilePath(colon + 1));
 | 
				
			||||||
@@ -856,8 +843,6 @@ TimeInMillis GetTimeInMillis() {
 | 
				
			|||||||
  SYSTEMTIME now_systime;
 | 
					  SYSTEMTIME now_systime;
 | 
				
			||||||
  FILETIME now_filetime;
 | 
					  FILETIME now_filetime;
 | 
				
			||||||
  ULARGE_INTEGER now_int64;
 | 
					  ULARGE_INTEGER now_int64;
 | 
				
			||||||
  // FIXME: Shouldn't this just use
 | 
					 | 
				
			||||||
  //   GetSystemTimeAsFileTime()?
 | 
					 | 
				
			||||||
  GetSystemTime(&now_systime);
 | 
					  GetSystemTime(&now_systime);
 | 
				
			||||||
  if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
 | 
					  if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
 | 
				
			||||||
    now_int64.LowPart = now_filetime.dwLowDateTime;
 | 
					    now_int64.LowPart = now_filetime.dwLowDateTime;
 | 
				
			||||||
@@ -872,8 +857,6 @@ TimeInMillis GetTimeInMillis() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
 | 
					  // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
 | 
				
			||||||
  // (deprecated function) there.
 | 
					  // (deprecated function) there.
 | 
				
			||||||
  // FIXME: Use GetTickCount()?  Or use
 | 
					 | 
				
			||||||
  //   SystemTimeToFileTime()
 | 
					 | 
				
			||||||
  GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
 | 
					  GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
 | 
				
			||||||
  _ftime64(&now);
 | 
					  _ftime64(&now);
 | 
				
			||||||
  GTEST_DISABLE_MSC_DEPRECATED_POP_()
 | 
					  GTEST_DISABLE_MSC_DEPRECATED_POP_()
 | 
				
			||||||
@@ -1407,8 +1390,6 @@ AssertionResult DoubleNearPredFormat(const char* expr1,
 | 
				
			|||||||
  const double diff = fabs(val1 - val2);
 | 
					  const double diff = fabs(val1 - val2);
 | 
				
			||||||
  if (diff <= abs_error) return AssertionSuccess();
 | 
					  if (diff <= abs_error) return AssertionSuccess();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // FIXME: do not print the value of an expression if it's
 | 
					 | 
				
			||||||
  // already a literal.
 | 
					 | 
				
			||||||
  return AssertionFailure()
 | 
					  return AssertionFailure()
 | 
				
			||||||
      << "The difference between " << expr1 << " and " << expr2
 | 
					      << "The difference between " << expr1 << " and " << expr2
 | 
				
			||||||
      << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
 | 
					      << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
 | 
				
			||||||
@@ -3388,7 +3369,6 @@ void TestEventRepeater::Append(TestEventListener *listener) {
 | 
				
			|||||||
  listeners_.push_back(listener);
 | 
					  listeners_.push_back(listener);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FIXME: Factor the search functionality into Vector::Find.
 | 
					 | 
				
			||||||
TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
 | 
					TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
 | 
				
			||||||
  for (size_t i = 0; i < listeners_.size(); ++i) {
 | 
					  for (size_t i = 0; i < listeners_.size(); ++i) {
 | 
				
			||||||
    if (listeners_[i] == listener) {
 | 
					    if (listeners_[i] == listener) {
 | 
				
			||||||
@@ -3576,8 +3556,6 @@ void XmlUnitTestResultPrinter::ListTestsMatchingFilter(
 | 
				
			|||||||
// module will consist of ordinary English text.
 | 
					// module will consist of ordinary English text.
 | 
				
			||||||
// If this module is ever modified to produce version 1.1 XML output,
 | 
					// If this module is ever modified to produce version 1.1 XML output,
 | 
				
			||||||
// most invalid characters can be retained using character references.
 | 
					// most invalid characters can be retained using character references.
 | 
				
			||||||
// FIXME: It might be nice to have a minimally invasive, human-readable
 | 
					 | 
				
			||||||
// escaping scheme for invalid characters, rather than dropping them.
 | 
					 | 
				
			||||||
std::string XmlUnitTestResultPrinter::EscapeXml(
 | 
					std::string XmlUnitTestResultPrinter::EscapeXml(
 | 
				
			||||||
    const std::string& str, bool is_attribute) {
 | 
					    const std::string& str, bool is_attribute) {
 | 
				
			||||||
  Message m;
 | 
					  Message m;
 | 
				
			||||||
@@ -3726,7 +3704,6 @@ void XmlUnitTestResultPrinter::OutputXmlAttribute(
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Prints an XML representation of a TestInfo object.
 | 
					// Prints an XML representation of a TestInfo object.
 | 
				
			||||||
// FIXME: There is also value in printing properties with the plain printer.
 | 
					 | 
				
			||||||
void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
 | 
					void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
 | 
				
			||||||
                                                 const char* test_case_name,
 | 
					                                                 const char* test_case_name,
 | 
				
			||||||
                                                 const TestInfo& test_info) {
 | 
					                                                 const TestInfo& test_info) {
 | 
				
			||||||
@@ -5717,8 +5694,6 @@ static bool HasGoogleTestFlagPrefix(const char* str) {
 | 
				
			|||||||
//   @Y    changes the color to yellow.
 | 
					//   @Y    changes the color to yellow.
 | 
				
			||||||
//   @D    changes to the default terminal text color.
 | 
					//   @D    changes to the default terminal text color.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// FIXME: Write tests for this once we add stdout
 | 
					 | 
				
			||||||
// capturing to Google Test.
 | 
					 | 
				
			||||||
static void PrintColorEncoded(const char* str) {
 | 
					static void PrintColorEncoded(const char* str) {
 | 
				
			||||||
  GTestColor color = COLOR_DEFAULT;  // The current color.
 | 
					  GTestColor color = COLOR_DEFAULT;  // The current color.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1281,9 +1281,6 @@ TEST(ParseNaturalNumberTest, WorksForShorterIntegers) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# if GTEST_OS_WINDOWS
 | 
					# if GTEST_OS_WINDOWS
 | 
				
			||||||
TEST(EnvironmentTest, HandleFitsIntoSizeT) {
 | 
					TEST(EnvironmentTest, HandleFitsIntoSizeT) {
 | 
				
			||||||
  // FIXME: Remove this test after this condition is verified
 | 
					 | 
				
			||||||
  // in a static assertion in gtest-death-test.cc in the function
 | 
					 | 
				
			||||||
  // GetStatusFileDescriptor.
 | 
					 | 
				
			||||||
  ASSERT_TRUE(sizeof(HANDLE) <= sizeof(size_t));
 | 
					  ASSERT_TRUE(sizeof(HANDLE) <= sizeof(size_t));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
# endif  // GTEST_OS_WINDOWS
 | 
					# endif  // GTEST_OS_WINDOWS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,8 +50,6 @@ namespace internal {
 | 
				
			|||||||
namespace {
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GTEST_OS_WINDOWS_MOBILE
 | 
					#if GTEST_OS_WINDOWS_MOBILE
 | 
				
			||||||
// FIXME: Move these to the POSIX adapter section in
 | 
					 | 
				
			||||||
// gtest-port.h.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Windows CE doesn't have the remove C function.
 | 
					// Windows CE doesn't have the remove C function.
 | 
				
			||||||
int remove(const char* path) {
 | 
					int remove(const char* path) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -136,11 +136,6 @@ class GTestJsonOutFilesTest(gtest_test_utils.TestCase):
 | 
				
			|||||||
    self.assert_(p.exited)
 | 
					    self.assert_(p.exited)
 | 
				
			||||||
    self.assertEquals(0, p.exit_code)
 | 
					    self.assertEquals(0, p.exit_code)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # FIXME: libtool causes the built test binary to be
 | 
					 | 
				
			||||||
    #   named lt-gtest_xml_outfiles_test_ instead of
 | 
					 | 
				
			||||||
    #   gtest_xml_outfiles_test_.  To account for this possibility, we
 | 
					 | 
				
			||||||
    #   allow both names in the following code.  We should remove this
 | 
					 | 
				
			||||||
    #   when libtool replacement tool is ready.
 | 
					 | 
				
			||||||
    output_file_name1 = test_name + '.json'
 | 
					    output_file_name1 = test_name + '.json'
 | 
				
			||||||
    output_file1 = os.path.join(self.output_dir_, output_file_name1)
 | 
					    output_file1 = os.path.join(self.output_dir_, output_file_name1)
 | 
				
			||||||
    output_file_name2 = 'lt-' + output_file_name1
 | 
					    output_file_name2 = 'lt-' + output_file_name1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -111,7 +111,6 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
 | 
				
			|||||||
#elif GTEST_OS_FUCHSIA
 | 
					#elif GTEST_OS_FUCHSIA
 | 
				
			||||||
  const bool success = exe_str == "app";
 | 
					  const bool success = exe_str == "app";
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
  // FIXME: remove the hard-coded "lt-" prefix when libtool replacement is ready
 | 
					 | 
				
			||||||
  const bool success =
 | 
					  const bool success =
 | 
				
			||||||
      exe_str == "googletest-options-test" ||
 | 
					      exe_str == "googletest-options-test" ||
 | 
				
			||||||
      exe_str == "gtest_all_test" ||
 | 
					      exe_str == "gtest_all_test" ||
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,7 +55,6 @@ NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
 | 
				
			|||||||
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
 | 
					IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
 | 
				
			||||||
IS_WINDOWS = os.name == 'nt'
 | 
					IS_WINDOWS = os.name == 'nt'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# FIXME: remove the _lin suffix.
 | 
					 | 
				
			||||||
GOLDEN_NAME = 'googletest-output-test-golden-lin.txt'
 | 
					GOLDEN_NAME = 'googletest-output-test-golden-lin.txt'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('googletest-output-test_')
 | 
					PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('googletest-output-test_')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -227,6 +227,4 @@ TEST_F(TestPartResultArrayDeathTest, DiesWhenIndexIsOutOfBound) {
 | 
				
			|||||||
  EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(1), "");
 | 
					  EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(1), "");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FIXME: Add a test for the class HasNewFatalFailureHelper.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}  // namespace
 | 
					}  // namespace
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,8 +73,7 @@ def Run(command):
 | 
				
			|||||||
  return p.exited and p.exit_code == 0
 | 
					  return p.exited and p.exit_code == 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# The tests.  FIXME: refactor the class to share common
 | 
					# The tests.
 | 
				
			||||||
# logic with code in googletest-break-on-failure-unittest.py.
 | 
					 | 
				
			||||||
class ThrowOnFailureTest(gtest_test_utils.TestCase):
 | 
					class ThrowOnFailureTest(gtest_test_utils.TestCase):
 | 
				
			||||||
  """Tests the throw-on-failure mode."""
 | 
					  """Tests the throw-on-failure mode."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,7 +96,6 @@ TEST(Test, Test) {
 | 
				
			|||||||
int kTestForContinuingTest = 0;
 | 
					int kTestForContinuingTest = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST(Test, Test2) {
 | 
					TEST(Test, Test2) {
 | 
				
			||||||
  // FIXME: how to force Test2 to be after Test?
 | 
					 | 
				
			||||||
  kTestForContinuingTest = 1;
 | 
					  kTestForContinuingTest = 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -117,7 +117,6 @@ const int kNumberOfParamTests = 10;
 | 
				
			|||||||
class MyParamTest : public testing::TestWithParam<int> {};
 | 
					class MyParamTest : public testing::TestWithParam<int> {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_P(MyParamTest, ShouldPass) {
 | 
					TEST_P(MyParamTest, ShouldPass) {
 | 
				
			||||||
  // FIXME: Make parameter value checking robust WRT order of tests.
 | 
					 | 
				
			||||||
  GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
 | 
					  GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
 | 
				
			||||||
  g_param_test_count++;
 | 
					  g_param_test_count++;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -307,8 +307,6 @@ def Main():
 | 
				
			|||||||
  _ParseAndStripGTestFlags(sys.argv)
 | 
					  _ParseAndStripGTestFlags(sys.argv)
 | 
				
			||||||
  # The tested binaries should not be writing XML output files unless the
 | 
					  # The tested binaries should not be writing XML output files unless the
 | 
				
			||||||
  # script explicitly instructs them to.
 | 
					  # script explicitly instructs them to.
 | 
				
			||||||
  # FIXME: Move this into Subprocess when we implement
 | 
					 | 
				
			||||||
  # passing environment into it as a parameter.
 | 
					 | 
				
			||||||
  if GTEST_OUTPUT_VAR_NAME in os.environ:
 | 
					  if GTEST_OUTPUT_VAR_NAME in os.environ:
 | 
				
			||||||
    del os.environ[GTEST_OUTPUT_VAR_NAME]
 | 
					    del os.environ[GTEST_OUTPUT_VAR_NAME]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7013,7 +7013,6 @@ GTEST_TEST(AlternativeNameTest, Works) {  // GTEST_TEST is the same as TEST.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Tests for internal utilities necessary for implementation of the universal
 | 
					// Tests for internal utilities necessary for implementation of the universal
 | 
				
			||||||
// printing.
 | 
					// printing.
 | 
				
			||||||
// FIXME: Find a better home for them.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ConversionHelperBase {};
 | 
					class ConversionHelperBase {};
 | 
				
			||||||
class ConversionHelperDerived : public ConversionHelperBase {};
 | 
					class ConversionHelperDerived : public ConversionHelperBase {};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -111,11 +111,6 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase):
 | 
				
			|||||||
    self.assert_(p.exited)
 | 
					    self.assert_(p.exited)
 | 
				
			||||||
    self.assertEquals(0, p.exit_code)
 | 
					    self.assertEquals(0, p.exit_code)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # FIXME: libtool causes the built test binary to be
 | 
					 | 
				
			||||||
    #   named lt-gtest_xml_outfiles_test_ instead of
 | 
					 | 
				
			||||||
    #   gtest_xml_outfiles_test_.  To account for this possibility, we
 | 
					 | 
				
			||||||
    #   allow both names in the following code.  We should remove this
 | 
					 | 
				
			||||||
    #   when libtool replacement tool is ready.
 | 
					 | 
				
			||||||
    output_file_name1 = test_name + ".xml"
 | 
					    output_file_name1 = test_name + ".xml"
 | 
				
			||||||
    output_file1 = os.path.join(self.output_dir_, output_file_name1)
 | 
					    output_file1 = os.path.join(self.output_dir_, output_file_name1)
 | 
				
			||||||
    output_file_name2 = 'lt-' + output_file_name1
 | 
					    output_file_name2 = 'lt-' + output_file_name1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user