いくつか失敗した場合にテストしたいと思います。モックオブジェクトに対してgoogle mockを使用してメソッドが呼び出されません。 ので、コードは次のようなものになる:google mock:モックでメソッドが呼び出されないようにするにはどうすればいいですか?
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
質問:あなたはどうしてあなたのオブジェクトをnew'ingしていますか?それは不要です... –