diff options
-rw-r--r-- | include/gmock/gmock-actions.h | 4 | ||||
-rw-r--r-- | include/gmock/gmock-generated-actions.h | 3 | ||||
-rw-r--r-- | include/gmock/gmock-generated-actions.h.pump | 3 | ||||
-rw-r--r-- | include/gmock/gmock-matchers.h | 19 | ||||
-rw-r--r-- | make/Makefile | 2 | ||||
-rw-r--r-- | test/gmock_link_test.h | 2 |
6 files changed, 17 insertions, 16 deletions
diff --git a/include/gmock/gmock-actions.h b/include/gmock/gmock-actions.h index a228eea6..a283ed73 100644 --- a/include/gmock/gmock-actions.h +++ b/include/gmock/gmock-actions.h @@ -597,7 +597,7 @@ class AssignAction { AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {} template <typename Result, typename ArgumentTuple> - void Perform(const ArgumentTuple &args) const { + void Perform(const ArgumentTuple& /* args */) const { *ptr_ = value_; } private: @@ -616,7 +616,7 @@ class SetErrnoAndReturnAction { : errno_(errno_value), result_(result) {} template <typename Result, typename ArgumentTuple> - Result Perform(const ArgumentTuple &args) const { + Result Perform(const ArgumentTuple& /* args */) const { errno = errno_; return result_; } diff --git a/include/gmock/gmock-generated-actions.h b/include/gmock/gmock-generated-actions.h index c2e155c2..60b5dc57 100644 --- a/include/gmock/gmock-generated-actions.h +++ b/include/gmock/gmock-generated-actions.h @@ -749,7 +749,7 @@ class SelectArgs<Result, ArgumentTuple, public: typedef Result type(); typedef typename Function<type>::ArgumentTuple SelectedArgs; - static SelectedArgs Select(const ArgumentTuple& args) { + static SelectedArgs Select(const ArgumentTuple& /* args */) { using ::std::tr1::get; return SelectedArgs(); } @@ -934,7 +934,6 @@ class WithArgsAction { const InnerAction action_; }; - // Does two actions sequentially. Used for implementing the DoAll(a1, // a2, ...) action. template <typename Action1, typename Action2> diff --git a/include/gmock/gmock-generated-actions.h.pump b/include/gmock/gmock-generated-actions.h.pump index 26f9319d..3854279e 100644 --- a/include/gmock/gmock-generated-actions.h.pump +++ b/include/gmock/gmock-generated-actions.h.pump @@ -314,7 +314,8 @@ class SelectArgs<Result, ArgumentTuple, public: typedef Result type($for j1, [[GMOCK_FIELD_(ArgumentTuple, k$j1)]]); typedef typename Function<type>::ArgumentTuple SelectedArgs; - static SelectedArgs Select(const ArgumentTuple& args) { + static SelectedArgs Select(const ArgumentTuple& [[]] +$if i == 1 [[/* args */]] $else [[args]]) { using ::std::tr1::get; return SelectedArgs($for j1, [[get<k$j1>(args)]]); } diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h index e6af144c..f764344d 100644 --- a/include/gmock/gmock-matchers.h +++ b/include/gmock/gmock-matchers.h @@ -90,7 +90,7 @@ class MatcherInterface { // Explains why x matches, or doesn't match, the matcher. Override // this to provide any additional information that helps a user // understand the match result. - virtual void ExplainMatchResultTo(T x, ::std::ostream* os) const { + virtual void ExplainMatchResultTo(T /* x */, ::std::ostream* /* os */) const { // By default, nothing more needs to be explained, as Google Mock // has already printed the value of x when this function is // called. @@ -146,8 +146,9 @@ class MatcherBase { // The default implementation of ExplainMatchResultTo() for // polymorphic matchers. template <typename PolymorphicMatcherImpl, typename T> -inline void ExplainMatchResultTo(const PolymorphicMatcherImpl& impl, const T& x, - ::std::ostream* os) { +inline void ExplainMatchResultTo(const PolymorphicMatcherImpl& /* impl */, + const T& /* x */, + ::std::ostream* /* os */) { // By default, nothing more needs to be said, as Google Mock already // prints the value of x elsewhere. } @@ -390,15 +391,15 @@ template <> class TuplePrefix<0> { public: template <typename MatcherTuple, typename ValueTuple> - static bool Matches(const MatcherTuple& matcher_tuple, - const ValueTuple& value_tuple) { + static bool Matches(const MatcherTuple& /* matcher_tuple */, + const ValueTuple& /* value_tuple */) { return true; } template <typename MatcherTuple, typename ValueTuple> - static void DescribeMatchFailuresTo(const MatcherTuple& matchers, - const ValueTuple& values, - ::std::ostream* os) {} + static void DescribeMatchFailuresTo(const MatcherTuple& /* matchers */, + const ValueTuple& /* values */, + ::std::ostream* /* os */) {} }; // TupleMatches(matcher_tuple, value_tuple) returns true iff all @@ -495,7 +496,7 @@ class MatcherCastImpl<T, Matcher<T> > { template <typename T> class AnyMatcherImpl : public MatcherInterface<T> { public: - virtual bool Matches(T x) const { return true; } + virtual bool Matches(T /* x */) const { return true; } virtual void DescribeTo(::std::ostream* os) const { *os << "is anything"; } virtual void DescribeNegationTo(::std::ostream* os) const { // This is mostly for completeness' safe, as it's not very useful diff --git a/make/Makefile b/make/Makefile index 85c8b38b..0c30ebfc 100644 --- a/make/Makefile +++ b/make/Makefile @@ -31,7 +31,7 @@ CPPFLAGS += -I$(GMOCK_DIR) -I$(GMOCK_DIR)/include \ -I$(GTEST_DIR) -I$(GTEST_DIR)/include # Flags passed to the C++ compiler. -CXXFLAGS += -g +CXXFLAGS += -g -Wall -Wextra -Wno-unused-parameter # All tests produced by this Makefile. Remember to add new tests you # created to the list. diff --git a/test/gmock_link_test.h b/test/gmock_link_test.h index 96cd79fb..4e0adb71 100644 --- a/test/gmock_link_test.h +++ b/test/gmock_link_test.h @@ -501,7 +501,7 @@ TEST(LinkTest, TestMatcherRef) { // Tests the linkage of the TypedEq matcher. TEST(LinkTest, TestMatcherTypedEq) { Mock mock; - unsigned long a = 0; + long a = 0; ON_CALL(mock, VoidFromIntRef(TypedEq<int&>(a))).WillByDefault(Return()); } |