We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
尝试对QTextStream的符号重载函数打桩失败 QTextStream& (*addrQTSOperator) (QTextStream*,const QString&)=(QTextStream& (*) (QTextStream*,const QString&)) ((QTextStream& (QTextStream::*)(const QString&))&QTextStream::operator<<); EMOCK(addrQTSOperator) .stubs() .will(invoke(mock_QTSOperator)); QTextStream& EMOCK_API mock_QTSOperator(QTextStream* obj,const QString& s) { auto fileName=((QFile*)(obj->device()))->fileName(); qDebug()<<fileName; qDebug()<<s; return *obj; } 报错如下: /home/ken/tstPluginSaveRuntime/lemock/include/emock/IsEqual.h:42: error: use of deleted function ‘QTextStream::QTextStream(const QTextStream&)’ lemock/include/emock/IsEqual.h:45:25: required from ‘bool emock::IsEqual<T>::eval(const emock::RefAny&) const [with T = QTextStream]’ lemock/include/emock/IsEqual.h:42:10: required from here lemock/include/emock/types/AnyCast.h:155:38: error: use of deleted function ‘QTextStream::QTextStream(const QTextStream&)’ 155 | return *const_cast<nonref*>(result); | ^ /usr/include/qt/QtCore/qtextstream.h:195:20: note: declared here 195 | Q_DISABLE_COPY(QTextStream) | ^~~~~~~~~~~ /usr/include/qt/QtCore/qglobal.h:443:5: note: in definition of macro ‘Q_DISABLE_COPY’ 443 | Class(const Class &) = delete;\ | ^~~~~
QTextStream& (*addrQTSOperator) (QTextStream*,const QString&)=(QTextStream& (*) (QTextStream*,const QString&)) ((QTextStream& (QTextStream::*)(const QString&))&QTextStream::operator<<); EMOCK(addrQTSOperator) .stubs() .will(invoke(mock_QTSOperator));
QTextStream& EMOCK_API mock_QTSOperator(QTextStream* obj,const QString& s) { auto fileName=((QFile*)(obj->device()))->fileName(); qDebug()<<fileName; qDebug()<<s; return *obj; }
/home/ken/tstPluginSaveRuntime/lemock/include/emock/IsEqual.h:42: error: use of deleted function ‘QTextStream::QTextStream(const QTextStream&)’ lemock/include/emock/IsEqual.h:45:25: required from ‘bool emock::IsEqual<T>::eval(const emock::RefAny&) const [with T = QTextStream]’ lemock/include/emock/IsEqual.h:42:10: required from here lemock/include/emock/types/AnyCast.h:155:38: error: use of deleted function ‘QTextStream::QTextStream(const QTextStream&)’ 155 | return *const_cast<nonref*>(result); | ^ /usr/include/qt/QtCore/qtextstream.h:195:20: note: declared here 195 | Q_DISABLE_COPY(QTextStream) | ^~~~~~~~~~~ /usr/include/qt/QtCore/qglobal.h:443:5: note: in definition of macro ‘Q_DISABLE_COPY’ 443 | Class(const Class &) = delete;\ | ^~~~~
The text was updated successfully, but these errors were encountered:
看报错是说拷贝构造函数被禁用,我晚点看下AnyCast.h的155行是啥
Sorry, something went wrong.
No branches or pull requests
尝试对QTextStream的符号重载函数打桩失败
QTextStream& (*addrQTSOperator) (QTextStream*,const QString&)=(QTextStream& (*) (QTextStream*,const QString&)) ((QTextStream& (QTextStream::*)(const QString&))&QTextStream::operator<<); EMOCK(addrQTSOperator) .stubs() .will(invoke(mock_QTSOperator));
QTextStream& EMOCK_API mock_QTSOperator(QTextStream* obj,const QString& s) { auto fileName=((QFile*)(obj->device()))->fileName(); qDebug()<<fileName; qDebug()<<s; return *obj; }
报错如下:
/home/ken/tstPluginSaveRuntime/lemock/include/emock/IsEqual.h:42: error: use of deleted function ‘QTextStream::QTextStream(const QTextStream&)’ lemock/include/emock/IsEqual.h:45:25: required from ‘bool emock::IsEqual<T>::eval(const emock::RefAny&) const [with T = QTextStream]’ lemock/include/emock/IsEqual.h:42:10: required from here lemock/include/emock/types/AnyCast.h:155:38: error: use of deleted function ‘QTextStream::QTextStream(const QTextStream&)’ 155 | return *const_cast<nonref*>(result); | ^ /usr/include/qt/QtCore/qtextstream.h:195:20: note: declared here 195 | Q_DISABLE_COPY(QTextStream) | ^~~~~~~~~~~ /usr/include/qt/QtCore/qglobal.h:443:5: note: in definition of macro ‘Q_DISABLE_COPY’ 443 | Class(const Class &) = delete;\ | ^~~~~
The text was updated successfully, but these errors were encountered: