diff options
author | Scott Slack-Smith <deenderah@gmail.com> | 2017-11-24 16:00:56 +0000 |
---|---|---|
committer | Scott Slack-Smith <deenderah@gmail.com> | 2017-11-24 16:00:56 +0000 |
commit | 6c093a2391eb66a42bd4146443265eddad06be0c (patch) | |
tree | b61e233a023b5c5a43c31520fd6b84f5a4b37788 /googlemock/src/gmock-spec-builders.cc | |
parent | c958e26fd02d43a916ff297c89eee22166fe7be7 (diff) | |
parent | d175c8bf823e709d570772b038757fadf63bc632 (diff) | |
download | googletest-6c093a2391eb66a42bd4146443265eddad06be0c.tar.gz googletest-6c093a2391eb66a42bd4146443265eddad06be0c.tar.bz2 googletest-6c093a2391eb66a42bd4146443265eddad06be0c.zip |
Merge branch 'master' of https://github.com/google/googletest
Diffstat (limited to 'googlemock/src/gmock-spec-builders.cc')
-rw-r--r-- | googlemock/src/gmock-spec-builders.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc index 2fa1ee4b..fc4968ba 100644 --- a/googlemock/src/gmock-spec-builders.cc +++ b/googlemock/src/gmock-spec-builders.cc @@ -353,10 +353,10 @@ UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args) // the behavior of ReportUninterestingCall(). const bool need_to_report_uninteresting_call = // If the user allows this uninteresting call, we print it - // only when he wants informational messages. + // only when they want informational messages. reaction == kAllow ? LogIsVisible(kInfo) : // If the user wants this to be a warning, we print it only - // when he wants to see warnings. + // when they want to see warnings. reaction == kWarn ? LogIsVisible(kWarning) : // Otherwise, the user wants this to be an error, and we // should always print detailed information in the error. @@ -364,7 +364,7 @@ UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args) if (!need_to_report_uninteresting_call) { // Perform the action without printing the call information. - return this->UntypedPerformDefaultAction(untyped_args, ""); + return this->UntypedPerformDefaultAction(untyped_args, "Function call: " + std::string(Name())); } // Warns about the uninteresting call. @@ -508,6 +508,13 @@ bool UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked() return expectations_met; } +CallReaction intToCallReaction(int mock_behavior) { + if (mock_behavior >= kAllow && mock_behavior <= kFail) { + return static_cast<internal::CallReaction>(mock_behavior); + } + return kWarn; +} + } // namespace internal // Class Mock. @@ -648,7 +655,8 @@ internal::CallReaction Mock::GetReactionOnUninterestingCalls( GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) { internal::MutexLock l(&internal::g_gmock_mutex); return (g_uninteresting_call_reaction.count(mock_obj) == 0) ? - internal::kDefault : g_uninteresting_call_reaction[mock_obj]; + internal::intToCallReaction(GMOCK_FLAG(default_mock_behavior)) : + g_uninteresting_call_reaction[mock_obj]; } // Tells Google Mock to ignore mock_obj when checking for leaked mock |