From f9522051f74188f8b043911822e66300419a7a15 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 9 Sep 2022 14:18:02 +0200 Subject: [PATCH] testFileTransfer(): Add more checks Make the target path more nested. Task-number: QTCREATORBUG-28151 Change-Id: Iae0660294d873e82e3fef0cbf2411f7c22ef526f Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/filesystemaccess_test.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/remotelinux/filesystemaccess_test.cpp b/src/plugins/remotelinux/filesystemaccess_test.cpp index 37b7b0da8ab..cb0cf3b83ee 100644 --- a/src/plugins/remotelinux/filesystemaccess_test.cpp +++ b/src/plugins/remotelinux/filesystemaccess_test.cpp @@ -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