aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock/gmock-more-actions.h
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2015-01-08 02:38:14 +0000
committerkosak <kosak@google.com>2015-01-08 02:38:14 +0000
commit6b817803104b30d5951c652a1427492db116a490 (patch)
treeeed0ecd43dfc84fafd59b95cd34584f6e0b24def /include/gmock/gmock-more-actions.h
parent61adbcc5c6b8e0385e3e2bf4262771d20a375002 (diff)
downloadgoogletest-6b817803104b30d5951c652a1427492db116a490.tar.gz
googletest-6b817803104b30d5951c652a1427492db116a490.tar.bz2
googletest-6b817803104b30d5951c652a1427492db116a490.zip
Makes DoubleNear() print the diff between the actual and the expected value when the match fails.
Also fix bogus MSVC warning about "alignment of a member was sensitive to packing". Also bring in gtest 701.
Diffstat (limited to 'include/gmock/gmock-more-actions.h')
-rw-r--r--include/gmock/gmock-more-actions.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/gmock/gmock-more-actions.h b/include/gmock/gmock-more-actions.h
index c754440e..3d387b6b 100644
--- a/include/gmock/gmock-more-actions.h
+++ b/include/gmock/gmock-more-actions.h
@@ -72,7 +72,7 @@ template <class Class, typename MethodPtr>
class InvokeMethodAction {
public:
InvokeMethodAction(Class* obj_ptr, MethodPtr method_ptr)
- : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
+ : method_ptr_(method_ptr), obj_ptr_(obj_ptr) {}
template <typename Result, typename ArgumentTuple>
Result Perform(const ArgumentTuple& args) const {
@@ -81,8 +81,11 @@ class InvokeMethodAction {
}
private:
- Class* const obj_ptr_;
+ // The order of these members matters. Reversing the order can trigger
+ // warning C4121 in MSVC (see
+ // http://computer-programming-forum.com/7-vc.net/6fbc30265f860ad1.htm ).
const MethodPtr method_ptr_;
+ Class* const obj_ptr_;
GTEST_DISALLOW_ASSIGN_(InvokeMethodAction);
};