summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-09-30 13:19:21 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-03 03:34:57 +0200
commit0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b (patch)
tree33c67e6b261357b5bd4a180e13bb48d26da5ca16 /tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
parent3c54bd67dacc2a5d11246213377e804be364a387 (diff)
Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: I31e069f5476f8adf9851e94b33c6afac4394b88e Reviewed-on: http://codereview.qt-project.org/5824 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp')
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index 34bc581396..88506e66a6 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -55,8 +55,9 @@ class tst_QClipboard : public QObject
{
Q_OBJECT
private slots:
-
+#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(QT_NO_PROCESS)
void copy_exit_paste();
+#endif
void capabiliyFunctions();
void modes();
void testSignals();
@@ -186,17 +187,13 @@ void tst_QClipboard::testSignals()
QCOMPARE(dataChangedSpy.count(), 1);
}
-/*
- Test that pasted text remain on the clipboard
- after a Qt application exits.
-*/
+// Test that pasted text remains on the clipboard after a Qt application exits.
+// This test does not make sense on X11 and embedded, as copied data disappears
+// from the clipboard when the application exits. It's still possible to test
+// copy/paste - just keep the apps running.
+#if !defined(Q_WS_X11) && !defined(Q_WS_QWS) && !defined(Q_WS_QPA) && !defined(QT_NO_PROCESS)
void tst_QClipboard::copy_exit_paste()
{
-#ifndef QT_NO_PROCESS
-#if defined Q_WS_X11 || defined Q_WS_QWS || defined (Q_WS_QPA)
- QSKIP("This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits ", SkipAll);
- // ### It's still possible to test copy/paste - just keep the apps running
-#endif
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup", SkipAll);
const QStringList stringArgument = QStringList() << "Test string.";
@@ -206,8 +203,8 @@ void tst_QClipboard::copy_exit_paste()
QTest::qWait(100);
#endif
QCOMPARE(QProcess::execute("paster/paster", stringArgument), 0);
-#endif
}
+#endif
void tst_QClipboard::setMimeData()
{