diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-02-18 09:36:56 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2021-02-21 18:46:28 -0800 |
commit | 73a04edce151b21ea5d07494603c0317716e99d9 (patch) | |
tree | 145b501dbb9a9ad5eb03e73c595b7066bdd47769 /tests/auto/corelib | |
parent | 86ebdc07dfd8c4df09b21ecc528dcae8d978f7e1 (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().
Pick-to: 6.1
Change-Id: Ic90d8429a0eb4837971dfffd1664e825ffcb923e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'tests/auto/corelib')
-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() |