Update googletest and googlemock to 1.8.0. (#90)

This commit is contained in:
Peter Johnson
2017-08-18 20:47:04 -07:00
committed by GitHub
parent 2d3cf1bdb1
commit dd85b1e519
46 changed files with 4523 additions and 1718 deletions

View File

@@ -191,9 +191,9 @@ GTEST_API_ string FormatMatcherDescription(bool negation,
// . [ sink ] .
//
// See Also:
// [1] Cormen, et al (2001). "Section 26.2: The FordFulkerson method".
// "Introduction to Algorithms (Second ed.)", pp. 651664.
// [2] "FordFulkerson algorithm", Wikipedia,
// [1] Cormen, et al (2001). "Section 26.2: The Ford-Fulkerson method".
// "Introduction to Algorithms (Second ed.)", pp. 651-664.
// [2] "Ford-Fulkerson algorithm", Wikipedia,
// 'http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'
class MaxBipartiteMatchState {
public:

View File

@@ -245,12 +245,22 @@ GTEST_API_ ThreadLocal<Sequence*> g_gmock_implicit_sequence;
// Reports an uninteresting call (whose description is in msg) in the
// manner specified by 'reaction'.
void ReportUninterestingCall(CallReaction reaction, const string& msg) {
// Include a stack trace only if --gmock_verbose=info is specified.
const int stack_frames_to_skip =
GMOCK_FLAG(verbose) == kInfoVerbosity ? 3 : -1;
switch (reaction) {
case kAllow:
Log(kInfo, msg, 3);
Log(kInfo, msg, stack_frames_to_skip);
break;
case kWarn:
Log(kWarning, msg, 3);
Log(kWarning,
msg +
"\nNOTE: You can safely ignore the above warning unless this "
"call should not happen. Do not suppress it by blindly adding "
"an EXPECT_CALL() if you don't mean to enforce the call. "
"See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#"
"knowing-when-to-expect for details.\n",
stack_frames_to_skip);
break;
default: // FAIL
Expect(false, NULL, -1, msg);
@@ -325,7 +335,7 @@ const char* UntypedFunctionMockerBase::Name() const
// Calculates the result of invoking this mock function with the given
// arguments, prints it, and returns it. The caller is responsible
// for deleting the result.
const UntypedActionResultHolderBase*
UntypedActionResultHolderBase*
UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
if (untyped_expectations_.size() == 0) {
@@ -363,7 +373,7 @@ UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
this->UntypedDescribeUninterestingCall(untyped_args, &ss);
// Calculates the function result.
const UntypedActionResultHolderBase* const result =
UntypedActionResultHolderBase* const result =
this->UntypedPerformDefaultAction(untyped_args, ss.str());
// Prints the function result.
@@ -410,7 +420,7 @@ UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
untyped_expectation->DescribeLocationTo(&loc);
}
const UntypedActionResultHolderBase* const result =
UntypedActionResultHolderBase* const result =
untyped_action == NULL ?
this->UntypedPerformDefaultAction(untyped_args, ss.str()) :
this->UntypedPerformAction(untyped_action, untyped_args);

View File

@@ -106,8 +106,9 @@ static bool ParseGoogleMockBoolFlag(const char* str, const char* flag,
//
// On success, stores the value of the flag in *value, and returns
// true. On failure, returns false without changing *value.
template <typename String>
static bool ParseGoogleMockStringFlag(const char* str, const char* flag,
std::string* value) {
String* value) {
// Gets the value of the flag as a string.
const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);