I am trying to reference an out argument of the mocked method getData. My problem is that "ControlData" has no copy constructor because it got deleted. As far as I understand, "SetArgReferee" does create an intermediate object before passing it by reference.
MOCK_METHOD1(getData, void(ControlData& par_rcl_ControlData));
ControlData loc_data;
EXPECT_CALL(loc_cl_control, getData(_)).WillOnce(SetArgReferee<0>(loc_data));
I have tried to create an custom action such as:
ACTION_P(SetArgRef, obj) { arg0 = &obj; }
But unfortunately this does not compile either. How can I pass an object directly on the mocked method?