summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-09-29 21:42:21 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-10-08 06:41:05 +0000
commitf27e029ef2e8400b803cec1b17ffd4e244d8610a (patch)
tree1c9dc915bf6336e747badedeba7a4a9563f723ab /tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
parentf0096a2bd329249528ffb21599c3378ecd3d856e (diff)
Autotest: use _exit() instead of exit() to simulate an unclean exit
We're not going to crash to avoid core dumps getting recorded by systemd, filling up filesystems or showing dialog boxes. We just need to exit without running destructors. Now, exit() isn't supposed to run function-scope destructors, so just in case we use _exit(). Change-Id: I0b48fc8e90304e0dacc3fffd14e909ff248ce1a1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp')
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index d2f345feb5..835c4a2778 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -262,7 +262,7 @@ void tst_QLockFile::staleLockFromCrashedProcess()
QFETCH(int, staleLockTime);
const QString fileName = dir.path() + "/staleLockFromCrashedProcess";
- int ret = QProcess::execute(m_helperApp, QStringList() << fileName << "-crash");
+ int ret = QProcess::execute(m_helperApp, QStringList() << fileName << "-uncleanexit");
QCOMPARE(ret, int(QLockFile::NoError));
QTRY_VERIFY(QFile::exists(fileName));
@@ -288,7 +288,7 @@ void tst_QLockFile::staleLockFromCrashedProcessReusedPid()
#else
const QString fileName = dir.path() + "/staleLockFromCrashedProcessReusedPid";
- int ret = QProcess::execute(m_helperApp, QStringList() << fileName << "-crash");
+ int ret = QProcess::execute(m_helperApp, QStringList() << fileName << "-uncleanexit");
QCOMPARE(ret, int(QLockFile::NoError));
QVERIFY(QFile::exists(fileName));
QVERIFY(overwritePidInLockFile(fileName, QCoreApplication::applicationPid()));
@@ -397,7 +397,7 @@ void tst_QLockFile::staleLockRace()
// Only one thread should delete it, otherwise a race will ensue
const QString fileName = dir.path() + "/sharedFile";
const QString lockName = fileName + ".lock";
- int ret = QProcess::execute(m_helperApp, QStringList() << lockName << "-crash");
+ int ret = QProcess::execute(m_helperApp, QStringList() << lockName << "-uncleanexit");
QCOMPARE(ret, int(QLockFile::NoError));
QTRY_VERIFY(QFile::exists(lockName));