diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-03-06 12:34:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-07 07:10:35 +0100 |
commit | 583349de0339df9384f3b69c6cda760939399d2f (patch) | |
tree | f3f8060f0a5d4cca17ef8dc82ffac3516c7333d9 | |
parent | 2041f4eae8e2ac9e144647e86f800484d0ef7438 (diff) |
Stabilize tst_qclipboard.
If the process terminates while QApplication::processEvents()
runs, the subsequent waitForFinished() returns false and the test
fails.
Task-number: QTBUG-29951
Change-Id: I41f461358920ad430951613dd919885f68ae212c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
-rw-r--r-- | tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp index 4470961f7b..89807f3747 100644 --- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp @@ -208,11 +208,12 @@ static bool runHelper(const QString &program, const QStringList &arguments, QByt // Windows: Due to implementation changes, the event loop needs // to be spun since we ourselves also need to answer the // WM_DRAWCLIPBOARD message as we are in the chain of clipboard - // viewers. + // viewers. Check for running before waitForFinished() in case + // the process terminated while processEvents() was executed. bool running = true; for (int i = 0; i < 60 && running; ++i) { QGuiApplication::processEvents(QEventLoop::ExcludeUserInputEvents); - if (process.waitForFinished(500)) + if (process.state() != QProcess::Running || process.waitForFinished(500)) running = false; } if (running) { |