Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Unified Diff: testing/gmock/include/gmock/gmock-more-actions.h

Issue 521012: Update gmock and gtest. (Closed)
Patch Set: update readme Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/gmock/include/gmock/gmock-matchers.h ('k') | testing/gmock/include/gmock/gmock-printers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/gmock/include/gmock/gmock-more-actions.h
diff --git a/testing/gmock/include/gmock/gmock-more-actions.h b/testing/gmock/include/gmock/gmock-more-actions.h
index c6fa6bbd70b4adf05d25157ffd750700b7b73429..6226392d714da5a214d92944ae2ff38994b59bab 100644
--- a/testing/gmock/include/gmock/gmock-more-actions.h
+++ b/testing/gmock/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_
« no previous file with comments | « testing/gmock/include/gmock/gmock-matchers.h ('k') | testing/gmock/include/gmock/gmock-printers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698