forked from qt-creator/qt-creator
testFileTransfer(): Add more checks
Make the target path more nested. Task-number: QTCREATORBUG-28151 Change-Id: Iae0660294d873e82e3fef0cbf2411f7c22ef526f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -241,7 +241,7 @@ void FileSystemAccessTest::testFileTransfer()
|
||||
QVERIFY2(dirForFilesToDownload.isValid(), qPrintable(dirForFilesToDownload.errorString()));
|
||||
QVERIFY2(dir2ForFilesToDownload.isValid(), qPrintable(dirForFilesToDownload.errorString()));
|
||||
static const auto getRemoteFilePath = [this](const QString &localFileName) {
|
||||
return m_device->filePath(QString("/tmp/").append(localFileName).append(".upload"));
|
||||
return m_device->filePath(QString("/tmp/foo/bar/").append(localFileName).append(".upload"));
|
||||
};
|
||||
FilesToTransfer filesToUpload;
|
||||
std::srand(QDateTime::currentDateTime().toSecsSinceEpoch());
|
||||
@@ -277,11 +277,11 @@ void FileSystemAccessTest::testFileTransfer()
|
||||
getRemoteFilePath(bigFileName)};
|
||||
fileTransfer.setFilesToTransfer(filesToUpload);
|
||||
|
||||
QString jobError;
|
||||
ProcessResultData result;
|
||||
QEventLoop loop;
|
||||
connect(&fileTransfer, &FileTransfer::done, [&jobError, &loop]
|
||||
connect(&fileTransfer, &FileTransfer::done, [&result, &loop]
|
||||
(const ProcessResultData &resultData) {
|
||||
jobError = resultData.m_errorString;
|
||||
result = resultData;
|
||||
loop.quit();
|
||||
});
|
||||
QTimer timer;
|
||||
@@ -293,7 +293,10 @@ void FileSystemAccessTest::testFileTransfer()
|
||||
loop.exec();
|
||||
QVERIFY(timer.isActive());
|
||||
timer.stop();
|
||||
QVERIFY2(jobError.isEmpty(), qPrintable(jobError));
|
||||
QCOMPARE(result.m_exitStatus, QProcess::NormalExit);
|
||||
QVERIFY2(result.m_errorString.isEmpty(), qPrintable(result.m_errorString));
|
||||
QCOMPARE(result.m_exitCode, 0);
|
||||
QCOMPARE(result.m_error, QProcess::UnknownError);
|
||||
}
|
||||
|
||||
} // Internal
|
||||
|
Reference in New Issue
Block a user