diff options
Diffstat (limited to 'tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp')
-rw-r--r-- | tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp index 80eb717790..4ac9a6bf5a 100644 --- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp +++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp @@ -75,17 +75,11 @@ private slots: void showMaximized(); void showMinimized(); void showFullScreen(); -#if !defined(Q_OS_UNIX) && !defined(Q_OS_WINCE) void showAsTool(); -#endif -#ifndef Q_OS_WINCE void toolDialogPosition(); -#endif void deleteMainDefault(); void deleteInExec(); -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_MAC) && !(defined(Q_OS_WINCE) && defined(_ARM_)) void throwInExec(); -#endif void showSizeGrip(); void setVisible(); void reject(); @@ -372,11 +366,13 @@ void tst_QDialog::showFullScreen() QVERIFY(!dialog.isVisible()); } -// Qt/X11: Skipped since activeWindow() is not respected by all window managers. -// Qt/WinCE: No real support for Qt::Tool on WinCE. -#if !defined(Q_OS_UNIX) && !defined(Q_OS_WINCE) void tst_QDialog::showAsTool() { +#if defined(Q_OS_UNIX) + QSKIP("Qt/X11: Skipped since activeWindow() is not respected by all window managers"); +#elif defined(Q_OS_WINCE) + QSKIP("No real support for Qt::Tool on WinCE"); +#endif ToolDialog dialog(testWidget); testWidget->activateWindow(); dialog.exec(); @@ -387,14 +383,14 @@ void tst_QDialog::showAsTool() QCOMPARE(dialog.wasActive(), false); } } -#endif // Verify that pos() returns the same before and after show() // for a dialog with the Tool window type. -// No real support for Qt::Tool on WinCE, so skip this test. -#ifndef Q_OS_WINCE void tst_QDialog::toolDialogPosition() { +#if defined(Q_OS_WINCE) + QSKIP("No real support for Qt::Tool on WinCE"); +#endif QDialog dialog(0, Qt::Tool); dialog.move(QPoint(100,100)); const QPoint beforeShowPosition = dialog.pos(); @@ -402,7 +398,6 @@ void tst_QDialog::toolDialogPosition() const QPoint afterShowPosition = dialog.pos(); QCOMPARE(afterShowPosition, beforeShowPosition); } -#endif class Dialog : public QDialog { @@ -430,8 +425,7 @@ void tst_QDialog::deleteInExec() QCOMPARE(dialog->exec(), int(QDialog::Rejected)); } -// Throwing exceptions in exec() is not supported on Mac or on WinCE/ARM. -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_MAC) && !(defined(Q_OS_WINCE) && defined(_ARM_)) +#ifndef QT_NO_EXCEPTIONS class QDialogTestException : public std::exception { }; class ExceptionDialog : public QDialog @@ -449,6 +443,9 @@ public slots: void tst_QDialog::throwInExec() { +#if defined(Q_WS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_)) + QSKIP("Throwing exceptions in exec() is not supported on this platform."); +#endif #if defined(Q_OS_LINUX) // C++ exceptions can't be passed through glib callbacks. Skip the test if // we're using the glib event loop. @@ -474,7 +471,12 @@ void tst_QDialog::throwInExec() } QCOMPARE(caughtExceptions, 1); } -#endif +#else +void tst_QDialog::throwInExec() +{ + QSKIP("Exceptions are disabled"); +} +#endif //QT_NO_EXCEPTIONS // From Task 124269 void tst_QDialog::showSizeGrip() |