diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-02-18 09:36:56 -0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-22 04:57:45 +0000 |
commit | 64c47d7f61ff51762709d45e8e69fa90926dc6a3 (patch) | |
tree | f45c37bd324a1cc465b7d769929bc95a01fd890a /tests | |
parent | 3961b82e6c7825cccf2da2c74e0ca90d45808b2b (diff) |
QProcess::startDetached: set the error condition on failure to start
And set *pid to -1.
[ChangeLog][QtCore][QProcess] If a startDetached() fails to start the
target application, the QProcess object should now have a proper error
string in errorString().
Change-Id: Ic90d8429a0eb4837971dfffd1664e825ffcb923e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 73a04edce151b21ea5d07494603c0317716e99d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index e68fccf4be..432fdc2e59 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -2279,6 +2279,8 @@ void tst_QProcess::detachedSetNonExistentWorkingDirectory() qint64 pid = -1; QVERIFY(!process.startDetached(&pid)); QCOMPARE(pid, -1); + QCOMPARE(process.error(), QProcess::FailedToStart); + QVERIFY(process.errorString() != "Unknown error"); } void tst_QProcess::startFinishStartFinish() |