diff options
author | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2009-12-23 00:13:23 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2009-12-23 00:13:23 +0000 |
commit | 32de5f53763125925e078498250f7e73a88de9ed (patch) | |
tree | cb5de0206e38598a12f10403de146faadcf9cdb0 /include/gmock/gmock-more-actions.h | |
parent | 284b54d3047254a8787e4f5eb9ba62a866caaabd (diff) | |
download | googletest-32de5f53763125925e078498250f7e73a88de9ed.tar.gz googletest-32de5f53763125925e078498250f7e73a88de9ed.tar.bz2 googletest-32de5f53763125925e078498250f7e73a88de9ed.zip |
Fixes a slew of compiler warnings and turns on "warning as error" in the scons build.
Diffstat (limited to 'include/gmock/gmock-more-actions.h')
-rw-r--r-- | include/gmock/gmock-more-actions.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/gmock/gmock-more-actions.h b/include/gmock/gmock-more-actions.h index c6fa6bbd..6226392d 100644 --- a/include/gmock/gmock-more-actions.h +++ b/include/gmock/gmock-more-actions.h @@ -58,8 +58,11 @@ class InvokeAction { Result Perform(const ArgumentTuple& args) { return InvokeHelper<Result, ArgumentTuple>::Invoke(function_impl_, args); } + private: FunctionImpl function_impl_; + + GTEST_DISALLOW_ASSIGN_(InvokeAction); }; // Implements the Invoke(object_ptr, &Class::Method) action. @@ -74,9 +77,12 @@ class InvokeMethodAction { return InvokeHelper<Result, ArgumentTuple>::InvokeMethod( obj_ptr_, method_ptr_, args); } + private: Class* const obj_ptr_; const MethodPtr method_ptr_; + + GTEST_DISALLOW_ASSIGN_(InvokeMethodAction); }; } // namespace internal @@ -122,6 +128,16 @@ WithArg(const InnerAction& action) { return internal::WithArgsAction<InnerAction, k>(action); } +// The ACTION*() macros trigger warning C4100 (unreferenced formal +// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in +// the macro definition, as the warnings are generated when the macro +// is expanded and macro expansion cannot contain #pragma. Therefore +// we suppress them here. +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4100) +#endif + // Action ReturnArg<k>() returns the k-th argument of the mock function. ACTION_TEMPLATE(ReturnArg, HAS_1_TEMPLATE_PARAMS(int, k), @@ -185,6 +201,10 @@ ACTION_TEMPLATE(DeleteArg, ACTION_P(Throw, exception) { throw exception; } #endif // GTEST_HAS_EXCEPTIONS +#ifdef _MSC_VER +#pragma warning(pop) +#endif + } // namespace testing #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ |