aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/gmock-spec-builders.h
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2018-10-12 16:12:32 -0400
committerGennadiy Civil <misterg@google.com>2018-10-12 16:12:32 -0400
commita651a4d44e65b749467fa3dddf93819a22f0cc4a (patch)
tree4163561ade61d99dc135d5d316059893ea2334d8 /googlemock/include/gmock/gmock-spec-builders.h
parent864b6c2d35db5c2c8ca4a4bad66e295a64f47011 (diff)
parentdec3b81a08f8e2d7f803f30fee2faa8b27c4bc26 (diff)
downloadgoogletest-a651a4d44e65b749467fa3dddf93819a22f0cc4a.tar.gz
googletest-a651a4d44e65b749467fa3dddf93819a22f0cc4a.tar.bz2
googletest-a651a4d44e65b749467fa3dddf93819a22f0cc4a.zip
Merge pull request #1908 from rwoldberg:master
PiperOrigin-RevId: 216909845
Diffstat (limited to 'googlemock/include/gmock/gmock-spec-builders.h')
-rw-r--r--googlemock/include/gmock/gmock-spec-builders.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h
index c8e864cc..b98e48b4 100644
--- a/googlemock/include/gmock/gmock-spec-builders.h
+++ b/googlemock/include/gmock/gmock-spec-builders.h
@@ -1184,9 +1184,10 @@ class TypedExpectation : public ExpectationBase {
Log(kWarning, ss.str(), 1);
}
- return count <= action_count ?
- *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :
- repeated_action();
+ return count <= action_count
+ ? *static_cast<const Action<F>*>(
+ untyped_actions_[static_cast<size_t>(count - 1)])
+ : repeated_action();
}
// Given the arguments of a mock function call, if the call will
@@ -1762,12 +1763,12 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
::std::ostream* why) const
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
g_gmock_mutex.AssertHeld();
- const int count = static_cast<int>(untyped_expectations_.size());
+ const size_t count = untyped_expectations_.size();
*why << "Google Mock tried the following " << count << " "
<< (count == 1 ? "expectation, but it didn't match" :
"expectations, but none matched")
<< ":\n";
- for (int i = 0; i < count; i++) {
+ for (size_t i = 0; i < count; i++) {
TypedExpectation<F>* const expectation =
static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get());
*why << "\n";