diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-12-09 17:14:52 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-13 09:33:49 +0100 |
commit | 1a5f5d0056288a4ebde4deadfe58ff9c59a15751 (patch) | |
tree | 909888a95da36c70646baf68ccad5a5b81e7a2c3 /tests/auto/gui/kernel/qclipboard/paster/main.cpp | |
parent | 3c189d9b743730a0c3b0aefb36b015399e85957d (diff) |
QClipboard-test: Fix test
- Use QFINDTESTDATA to locate sub-executables
- Remove dependency on QtWidgets, use QGuiApplication everywhere.
- Improve error handling when running sub-executables, prevent
hangs (Windows)
Change-Id: If8e3be82f855c8be6bdbfc9f9728e8490ed181f3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/gui/kernel/qclipboard/paster/main.cpp')
-rw-r--r-- | tests/auto/gui/kernel/qclipboard/paster/main.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/auto/gui/kernel/qclipboard/paster/main.cpp b/tests/auto/gui/kernel/qclipboard/paster/main.cpp index 4df4d7fb45..e4f7864061 100644 --- a/tests/auto/gui/kernel/qclipboard/paster/main.cpp +++ b/tests/auto/gui/kernel/qclipboard/paster/main.cpp @@ -38,17 +38,18 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include <QApplication> -#include <QClipboard> -#include <QStringList> +#include <QtGui/QGuiApplication> +#include <QtGui/QClipboard> +#include <QtCore/QStringList> int main(int argc, char **argv) { - QApplication app(argc, argv); - QClipboard *board = QApplication::clipboard(); -#ifdef Q_OS_WINCE - return (board->text() == QLatin1String("testString.!")) ? 0 : 1; -#else - return (board->text() == app.arguments().at(1)) ? 0 : 1; + QGuiApplication app(argc, argv); + QString expected = QStringLiteral("testString.!"); +#ifndef Q_OS_WINCE + const QStringList arguments = app.arguments(); + if (arguments.size() > 1) + expected = arguments.at(1); #endif + return QGuiApplication::clipboard()->text() == expected ? 0 : 1; } |