aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2014-11-17 01:08:51 +0000
committerkosak <kosak@google.com>2014-11-17 01:08:51 +0000
commit389bad61e2ebe3e99aaf17cb157f43beeb03ba4d (patch)
tree1c04d3820c6a78e9b3d7ed0c4f280e2ca1362809
parent3d1c78b2bff05a794b037b99766640f8f2b19855 (diff)
downloadgoogletest-389bad61e2ebe3e99aaf17cb157f43beeb03ba4d.tar.gz
googletest-389bad61e2ebe3e99aaf17cb157f43beeb03ba4d.tar.bz2
googletest-389bad61e2ebe3e99aaf17cb157f43beeb03ba4d.zip
Silence a signedness-comparison warning in gmock-actions_test.
include <functional> when using std::function in gmock.
-rw-r--r--include/gmock/gmock-generated-function-mockers.h4
-rw-r--r--include/gmock/gmock-generated-function-mockers.h.pump4
-rw-r--r--test/gmock-actions_test.cc4
3 files changed, 10 insertions, 2 deletions
diff --git a/include/gmock/gmock-generated-function-mockers.h b/include/gmock/gmock-generated-function-mockers.h
index ce7341d4..b98b4716 100644
--- a/include/gmock/gmock-generated-function-mockers.h
+++ b/include/gmock/gmock-generated-function-mockers.h
@@ -43,6 +43,10 @@
#include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-internal-utils.h"
+#if GTEST_HAS_STD_FUNCTION_
+# include <functional>
+#endif
+
namespace testing {
namespace internal {
diff --git a/include/gmock/gmock-generated-function-mockers.h.pump b/include/gmock/gmock-generated-function-mockers.h.pump
index 59284457..b099676c 100644
--- a/include/gmock/gmock-generated-function-mockers.h.pump
+++ b/include/gmock/gmock-generated-function-mockers.h.pump
@@ -44,6 +44,10 @@ $var n = 10 $$ The maximum arity we support.
#include "gmock/gmock-spec-builders.h"
#include "gmock/internal/gmock-internal-utils.h"
+#if GTEST_HAS_STD_FUNCTION_
+# include <functional>
+#endif
+
namespace testing {
namespace internal {
diff --git a/test/gmock-actions_test.cc b/test/gmock-actions_test.cc
index ea09bfc9..28b48f16 100644
--- a/test/gmock-actions_test.cc
+++ b/test/gmock-actions_test.cc
@@ -1301,7 +1301,7 @@ TEST(MockMethodTest, CanReturnMoveOnlyValue_Return) {
EXPECT_EQ(19, *result1);
std::vector<std::unique_ptr<int>> vresult = mock.MakeVectorUnique();
- EXPECT_EQ(1, vresult.size());
+ EXPECT_EQ(1u, vresult.size());
EXPECT_NE(nullptr, vresult[0]);
EXPECT_EQ(7, *vresult[0]);
@@ -1341,7 +1341,7 @@ TEST(MockMethodTest, CanReturnMoveOnlyValue_Invoke) {
EXPECT_NE(result1, result2);
std::vector<std::unique_ptr<int>> vresult = mock.MakeVectorUnique();
- EXPECT_EQ(1, vresult.size());
+ EXPECT_EQ(1u, vresult.size());
EXPECT_NE(nullptr, vresult[0]);
EXPECT_EQ(7, *vresult[0]);
}