Google モックを使用して、何らかの失敗があった場合にモック オブジェクトでメソッドが呼び出されないことをテストしたいと思います。コードは次のようになります。
auto mocObj = new MockObj;
EXPECT_NO_METHOD_CALL(mocObj); //this is what I'm locking for
auto mainObj = new MainObj(mocObj , ......and other mocks); // here I simulate a fail using the other mock objects, and I want to be sure the no methods are called on the mockObj