+ Simple |
+ Old | `MOCK_METHOD1(Foo, bool(int))` |
+ New | `MOCK_METHOD(bool, Foo, (int))` |
+
+ Const Method |
Old |
+`MOCK_CONST_METHOD1(Foo, bool(int))` |
New |
+`MOCK_METHOD(bool, Foo, (int), (const))` |
+
+ Method in a Class Template |
Old |
+ `MOCK_METHOD1_T(Foo, bool(int))` |
New |
+`MOCK_METHOD(bool, Foo, (int))` |
+
+ Const Method in a Class Template |
Old
+ | `MOCK_CONST_METHOD1_T(Foo, bool(int))` |
New
+ | `MOCK_METHOD(bool, Foo, (int), (const))` |
+
+ Method with Call Type |
Old |
+`MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))` |
+ New | `MOCK_METHOD(bool, Foo, (int),
+(Calltype(STDMETHODCALLTYPE)))` |
+
+ Const Method with Call Type |
Old |
+ `MOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))` |
+
New | `MOCK_METHOD(bool, Foo, (int), (const,
+Calltype(STDMETHODCALLTYPE)))` |
+
+ Method with Call Type in a Class Template |
+ Old | `MOCK_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo,
+bool(int))` |
New | `MOCK_METHOD(bool, Foo, (int),
+(Calltype(STDMETHODCALLTYPE)))` |
+
+ Const Method with Call Type in a Class Template |
+ Old | `MOCK_CONST_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE,
+Foo, bool(int))` |
New | `MOCK_METHOD(bool, Foo,
+(int), (const, Calltype(STDMETHODCALLTYPE)))` |
+
+
+
+### The Nice, the Strict, and the Naggy {#NiceStrictNaggy}
+
+If a mock method has no `EXPECT_CALL` spec but is called, we say that it's an
+"uninteresting call", and the default action (which can be specified using
+`ON_CALL()`) of the method will be taken. Currently, an uninteresting call will
+also by default cause gMock to print a warning. (In the future, we might remove
+this warning by default.)
+
+However, sometimes you may want to ignore these uninteresting calls, and
+sometimes you may want to treat them as errors. gMock lets you make the decision
+on a per-mock-object basis.
+
+Suppose your test uses a mock class `MockFoo`:
+
+```cpp
+TEST(...) {
+ MockFoo mock_foo;
+ EXPECT_CALL(mock_foo, DoThis());
+ ... code that uses mock_foo ...
+}
+```
+
+If a method of `mock_foo` other than `DoThis()` is called, you will get a
+warning. However, if you rewrite your test to use `NiceMock