diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-19 12:12:10 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-19 12:12:10 (GMT) |
commit | bd593fa64efebbe6608631ec9c08290414389c16 (patch) | |
tree | 5fdad4f2827d6025ba4c3e8eba78a8438f90b1e4 /tests/auto | |
parent | 4676dd62871da2b58452ebda477a04c25158bec4 (diff) | |
parent | 7a51c6023ffd2a6e222b842a34d62b7f3ce8db4b (diff) | |
download | Qt-bd593fa64efebbe6608631ec9c08290414389c16.zip Qt-bd593fa64efebbe6608631ec9c08290414389c16.tar.gz Qt-bd593fa64efebbe6608631ec9c08290414389c16.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
qdoc: Added online flag to the qdocconf file.
I10n: Update German translations for 4.7.0
Fix compile warning.
Report the error as being AlreadyExists if this is why it fails
move network scan to thread.
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp index eb82fd4..0dc9c99 100644 --- a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp +++ b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp @@ -76,6 +76,8 @@ private slots: void undo(); void initialValue(); + void exists(); + private: QSystemSemaphore *existingLock; @@ -297,6 +299,29 @@ void tst_QSystemSemaphore::initialValue() release.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); } + +void tst_QSystemSemaphore::exists() +{ + QSystemSemaphore sem("store", 1, QSystemSemaphore::Create); + QVERIFY(sem.error() == QSystemSemaphore::NoError); + QVERIFY(sem.acquire()); + QVERIFY(sem.error() == QSystemSemaphore::NoError); + + { + QSystemSemaphore dupSem("store", 1, QSystemSemaphore::Create); + QVERIFY(dupSem.error() == QSystemSemaphore::AlreadyExists); + } +#ifndef Q_OS_UNIX + // The rest of the test does not make sense on Unix because open will + // actually succeed anyway (see QSystemSemaphore docs) + QSystemSemaphore anotherSem("store", 1, QSystemSemaphore::Open); + QVERIFY(anotherSem.error() == QSystemSemaphore::AlreadyExists); + QVERIFY(sem.release()); + QVERIFY(anotherSem.acquire()); + QVERIFY(anotherSem.release()); +#endif +} + QTEST_MAIN(tst_QSystemSemaphore) #include "tst_qsystemsemaphore.moc" |