i am trying to mock a class function that is a
template<class T> QSharedPointer<T>
I checked a bit on StackOverflow but others examples are really complicated. Here is my class function:
template<class T> QSharedPointer<T> getObjectWithId ( int id )
{
QSharedPointer<SqlObject> obj = getObjectWithId ( T::staticMetaObject.className(), id );
return qSharedPointerCast<T> ( obj );
}
I would like to mock this function like this
class MockingSqlConnector : public SqlObjectFactory
{
public:
MOCK_METHOD ( auto, getObjectWithId, ( int id ), ( override ) );
};
I get the error: overloaded function "SqlObjectFactory::getObjectWithId" is not a type name