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: I95feba3edbfa092c0ef4d85bb8c6877bd6be698e
Reviewed-on: http://codereview.qt-project.org/6128
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Jason McDonald 2011-10-06 18:56:31 +10:00 committed by Qt by Nokia
parent 13251dcaea
commit 924d810dbd
17 changed files with 191 additions and 182 deletions

View File

@ -55,8 +55,9 @@ class tst_QTextCodec : public QObject
Q_OBJECT Q_OBJECT
private slots: private slots:
#ifndef QT_NO_CONCURRENT
void threadSafety(); void threadSafety();
#endif
void toUnicode_data(); void toUnicode_data();
void toUnicode(); void toUnicode();
@ -1976,24 +1977,21 @@ static int loadAndConvertMIB(int mib)
} }
#ifndef QT_NO_CONCURRENT
void tst_QTextCodec::threadSafety() void tst_QTextCodec::threadSafety()
{ {
QList<QByteArray> codecList = QTextCodec::availableCodecs(); QList<QByteArray> codecList = QTextCodec::availableCodecs();
QList<int> mibList = QTextCodec::availableMibs(); QList<int> mibList = QTextCodec::availableMibs();
#ifndef QT_NO_CONCURRENT
QThreadPool::globalInstance()->setMaxThreadCount(12); QThreadPool::globalInstance()->setMaxThreadCount(12);
QFuture<QByteArray> res = QtConcurrent::mapped(codecList, loadAndConvert); QFuture<QByteArray> res = QtConcurrent::mapped(codecList, loadAndConvert);
QFuture<int> res2 = QtConcurrent::mapped(mibList, loadAndConvertMIB); QFuture<int> res2 = QtConcurrent::mapped(mibList, loadAndConvertMIB);
QCOMPARE(res.results(), codecList); QCOMPARE(res.results(), codecList);
QCOMPARE(res2.results(), mibList); QCOMPARE(res2.results(), mibList);
#else
QSKIP("This function is not yet supported with QT_NO_CONCURRENT defined.", SkipAll);
#endif
} }
#endif
void tst_QTextCodec::invalidNames() void tst_QTextCodec::invalidNames()
{ {

View File

@ -609,10 +609,10 @@ void tst_QFile::size()
fclose(stream); fclose(stream);
} }
// Currently low level file I/O is not well supported on Windows CE, so
// skip this part of the test.
#ifndef Q_OS_WINCE
{ {
#ifdef Q_OS_WINCE
QSKIP("Currently low level file I/O not well supported on Windows CE", SkipSingle);
#endif
QFile f; QFile f;
int fd = QT_OPEN(filename.toLocal8Bit().constData(), QT_OPEN_RDONLY); int fd = QT_OPEN(filename.toLocal8Bit().constData(), QT_OPEN_RDONLY);
@ -624,6 +624,7 @@ void tst_QFile::size()
f.close(); f.close();
QT_CLOSE(fd); QT_CLOSE(fd);
} }
#endif
} }
void tst_QFile::sizeNoExist() void tst_QFile::sizeNoExist()

View File

@ -170,6 +170,8 @@ private slots:
void detachedWorkingDirectoryAndPid(); void detachedWorkingDirectoryAndPid();
#ifndef Q_OS_WINCE #ifndef Q_OS_WINCE
void switchReadChannels(); void switchReadChannels();
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
void setWorkingDirectory(); void setWorkingDirectory();
#endif #endif
void startFinishStartFinish(); void startFinishStartFinish();
@ -2188,8 +2190,9 @@ void tst_QProcess::switchReadChannels()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Windows CE does not support working directory logic. // Windows CE does not support working directory logic, and
#ifndef Q_OS_WINCE // setWorkingDirectory will chdir before starting the process on unices.
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
void tst_QProcess::setWorkingDirectory() void tst_QProcess::setWorkingDirectory()
{ {
process = new QProcess; process = new QProcess;
@ -2198,9 +2201,6 @@ void tst_QProcess::setWorkingDirectory()
process->start("testSetWorkingDirectory/testSetWorkingDirectory.app"); process->start("testSetWorkingDirectory/testSetWorkingDirectory.app");
#else #else
process->start("testSetWorkingDirectory/testSetWorkingDirectory"); process->start("testSetWorkingDirectory/testSetWorkingDirectory");
#endif
#ifndef Q_OS_WIN
QSKIP("setWorkingDirectory will chdir before starting the process on unices", SkipAll);
#endif #endif
QVERIFY(process->waitForFinished()); QVERIFY(process->waitForFinished());

View File

@ -325,7 +325,11 @@ void tst_QSharedMemory::attach_data()
QTest::newRow("null key") << QString() << false << QSharedMemory::KeyError; QTest::newRow("null key") << QString() << false << QSharedMemory::KeyError;
QTest::newRow("doesn't exists") << QString("doesntexists") << false << QSharedMemory::NotFound; QTest::newRow("doesn't exists") << QString("doesntexists") << false << QSharedMemory::NotFound;
// HPUX doesn't allow for multiple attaches per process.
#ifndef Q_OS_HPUX
QTest::newRow("already exists") << QString(EXISTING_SHARE) << true << QSharedMemory::NoError; QTest::newRow("already exists") << QString(EXISTING_SHARE) << true << QSharedMemory::NoError;
#endif
} }
/*! /*!
@ -336,11 +340,7 @@ void tst_QSharedMemory::attach()
QFETCH(QString, key); QFETCH(QString, key);
QFETCH(bool, exists); QFETCH(bool, exists);
QFETCH(QSharedMemory::SharedMemoryError, error); QFETCH(QSharedMemory::SharedMemoryError, error);
#ifdef Q_OS_HPUX
if (QLatin1String(QTest::currentDataTag()) == QLatin1String("already exists")) {
QSKIP("HPUX doesn't allow for multiple attaches per process", SkipSingle);
}
#endif
QSharedMemory sm(key); QSharedMemory sm(key);
QCOMPARE(sm.attach(), exists); QCOMPARE(sm.attach(), exists);
QCOMPARE(sm.isAttached(), exists); QCOMPARE(sm.isAttached(), exists);

View File

@ -117,7 +117,9 @@ private slots:
void startFinishRace(); void startFinishRace();
void startAndQuitCustomEventLoop(); void startAndQuitCustomEventLoop();
#ifndef Q_OS_WINCE
void stressTest(); void stressTest();
#endif
}; };
enum { one_minute = 60 * 1000, five_minutes = 5 * one_minute }; enum { one_minute = 60 * 1000, five_minutes = 5 * one_minute };
@ -990,11 +992,11 @@ void tst_QThread::adoptMultipleThreadsOverlap()
QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(int(recorder.activationCount), numThreads); QCOMPARE(int(recorder.activationCount), numThreads);
} }
// Disconnects on WinCE, so skip this test.
#ifndef Q_OS_WINCE
void tst_QThread::stressTest() void tst_QThread::stressTest()
{ {
#if defined(Q_OS_WINCE)
QSKIP("Disconnects on WinCE, skipping...", SkipAll);
#endif
QTime t; QTime t;
t.start(); t.start();
while (t.elapsed() < one_minute) { while (t.elapsed() < one_minute) {
@ -1003,6 +1005,7 @@ void tst_QThread::stressTest()
t.wait(one_minute); t.wait(one_minute);
} }
} }
#endif
class Syncronizer : public QObject class Syncronizer : public QObject
{ Q_OBJECT { Q_OBJECT

View File

@ -873,10 +873,8 @@ void tst_QString::STL()
QVERIFY( !stdstr3.length() ); QVERIFY( !stdstr3.length() );
#endif #endif
//skip test if glibc is not compiled with wide character support // Skip the rest of the test if glibc is not compiled with wide character support
#if (defined Q_CC_GNU && !defined _GLIBCPP_USE_WCHAR_T) || defined QT_NO_STL_WCHAR #if !(defined Q_CC_GNU && !defined _GLIBCPP_USE_WCHAR_T) && !defined QT_NO_STL_WCHAR
QSKIP( "Not tested without wide character support", SkipAll);
#else
const wchar_t arr[] = {'h', 'e', 'l', 'l', 'o', 0}; const wchar_t arr[] = {'h', 'e', 'l', 'l', 'o', 0};
QStdWString stlStr = arr; QStdWString stlStr = arr;

View File

@ -150,7 +150,7 @@ private slots:
void achromaticHslHue(); void achromaticHslHue();
#ifdef Q_WS_X11 #if defined(Q_WS_X11) && !defined(Q_OS_IRIX)
void allowX11ColorNames(); void allowX11ColorNames();
void setallowX11ColorNames(); void setallowX11ColorNames();
#endif #endif
@ -1469,7 +1469,8 @@ void tst_QColor::achromaticHslHue()
QCOMPARE(hsl.hslHue(), -1); QCOMPARE(hsl.hslHue(), -1);
} }
#ifdef Q_WS_X11 // This test fails on IRIX due to the gamma settings in the SGI X server.
#if defined(Q_WS_X11) && !defined(Q_OS_IRIX)
void tst_QColor::allowX11ColorNames() void tst_QColor::allowX11ColorNames()
{ {
DEPENDS_ON(setallowX11ColorNames()); DEPENDS_ON(setallowX11ColorNames());
@ -1477,9 +1478,6 @@ void tst_QColor::allowX11ColorNames()
void tst_QColor::setallowX11ColorNames() void tst_QColor::setallowX11ColorNames()
{ {
#if defined(Q_OS_IRIX)
QSKIP("This fails due to the gamma settings in the SGI X server", SkipAll);
#else
RGBData x11RgbTbl[] = { RGBData x11RgbTbl[] = {
// a few standard X11 color names // a few standard X11 color names
{ "DodgerBlue1", qRgb(30, 144, 255) }, { "DodgerBlue1", qRgb(30, 144, 255) },
@ -1530,9 +1528,8 @@ void tst_QColor::setallowX11ColorNames()
color.setNamedColor(colorName); color.setNamedColor(colorName);
QVERIFY(!color.isValid()); QVERIFY(!color.isValid());
} }
#endif // Q_OS_IRIX
} }
#endif // Q_WS_X11 #endif
QTEST_MAIN(tst_QColor) QTEST_MAIN(tst_QColor)
#include "tst_qcolor.moc" #include "tst_qcolor.moc"

View File

@ -67,7 +67,9 @@ public slots:
void cleanup(); void cleanup();
private slots: private slots:
void getSetCheck(); void getSetCheck();
#ifndef Q_WS_WIN
void exactMatch(); void exactMatch();
#endif
void compare(); void compare();
void resolve(); void resolve();
void resetFont(); void resetFont();
@ -148,6 +150,8 @@ void tst_QFont::cleanup()
// This will be executed immediately after each test is run. // This will be executed immediately after each test is run.
} }
// Exact matching on windows misses a lot because of the sample chars.
#ifndef Q_WS_WIN
void tst_QFont::exactMatch() void tst_QFont::exactMatch()
{ {
QFont font; QFont font;
@ -156,11 +160,6 @@ void tst_QFont::exactMatch()
font = QFont( "BogusFont", 33 ); font = QFont( "BogusFont", 33 );
QVERIFY( !font.exactMatch() ); QVERIFY( !font.exactMatch() );
#ifdef Q_WS_WIN
QSKIP("Exact matching on windows misses a lot because of the sample chars", SkipAll);
return;
#endif
#ifdef Q_WS_X11 #ifdef Q_WS_X11
QVERIFY(QFont("sans").exactMatch()); QVERIFY(QFont("sans").exactMatch());
QVERIFY(QFont("sans-serif").exactMatch()); QVERIFY(QFont("sans-serif").exactMatch());
@ -309,6 +308,7 @@ void tst_QFont::exactMatch()
} }
} }
} }
#endif
void tst_QFont::italicOblique() void tst_QFont::italicOblique()
{ {

View File

@ -656,12 +656,8 @@ void tst_PlatformSocketEngine::receiveUrgentData()
int available; int available;
QByteArray response; QByteArray response;
#if defined Q_OS_HPUX // Native OOB data test doesn't work on HP-UX or WinCE
QSKIP("Native OOB data test doesn't work on HP-UX.", SkipAll); #if !defined(Q_OS_HPUX) && !defined(Q_OS_WINCE)
#elif defined (Q_OS_WINCE)
QSKIP("Native OOB data test doesn't work on WinCE.", SkipAll);
#endif
// The server sends an urgent message // The server sends an urgent message
msg = 'Q'; msg = 'Q';
QCOMPARE(int(::send(socketDescriptor, &msg, sizeof(msg), MSG_OOB)), 1); QCOMPARE(int(::send(socketDescriptor, &msg, sizeof(msg), MSG_OOB)), 1);
@ -686,6 +682,7 @@ void tst_PlatformSocketEngine::receiveUrgentData()
response.resize(available); response.resize(available);
QCOMPARE(serverSocket.read(response.data(), response.size()), qint64(1)); QCOMPARE(serverSocket.read(response.data(), response.size()), qint64(1));
QCOMPARE(response.at(0), msg); QCOMPARE(response.at(0), msg);
#endif
} }
QTEST_MAIN(tst_PlatformSocketEngine) QTEST_MAIN(tst_PlatformSocketEngine)

View File

@ -114,7 +114,9 @@ private slots:
void scrollBarAsNeeded(); void scrollBarAsNeeded();
void moveItems(); void moveItems();
void wordWrap(); void wordWrap();
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && WINVER >= 0x0500
void setCurrentIndexAfterAppendRowCrash(); void setCurrentIndexAfterAppendRowCrash();
#endif
void emptyItemSize(); void emptyItemSize();
void task203585_selectAll(); void task203585_selectAll();
void task228566_infiniteRelayout(); void task228566_infiniteRelayout();
@ -1496,15 +1498,14 @@ private:
}; };
#endif #endif
// This test only makes sense on Windows 2000 and higher.
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && WINVER >= 0x0500
void tst_QListView::setCurrentIndexAfterAppendRowCrash() void tst_QListView::setCurrentIndexAfterAppendRowCrash()
{ {
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && WINVER >= 0x0500
SetCurrentIndexAfterAppendRowCrashDialog w; SetCurrentIndexAfterAppendRowCrashDialog w;
w.exec(); w.exec();
#else
QSKIP("This test only makes sense on windows 2000 and higher.", SkipAll);
#endif
} }
#endif
void tst_QListView::emptyItemSize() void tst_QListView::emptyItemSize()
{ {

View File

@ -77,8 +77,10 @@ private slots:
void setIconSize(); void setIconSize();
void toolButtonStyle(); void toolButtonStyle();
void setToolButtonStyle(); void setToolButtonStyle();
#ifndef Q_WS_WINCE_WM
void menuBar(); void menuBar();
void setMenuBar(); void setMenuBar();
#endif
void statusBar(); void statusBar();
void setStatusBar(); void setStatusBar();
void centralWidget(); void centralWidget();
@ -544,6 +546,8 @@ void tst_QMainWindow::toolButtonStyle()
void tst_QMainWindow::setToolButtonStyle() void tst_QMainWindow::setToolButtonStyle()
{ DEPENDS_ON("toolButtonStyle()"); } { DEPENDS_ON("toolButtonStyle()"); }
// With native menubar integration on Windows Mobile the menubar is not a child
#ifndef Q_WS_WINCE_WM
void tst_QMainWindow::menuBar() void tst_QMainWindow::menuBar()
{ {
{ {
@ -559,9 +563,6 @@ void tst_QMainWindow::menuBar()
mw.setMenuBar(mb1); mw.setMenuBar(mb1);
QVERIFY(mw.menuBar() != 0); QVERIFY(mw.menuBar() != 0);
QCOMPARE(mw.menuBar(), (QMenuBar *)mb1); QCOMPARE(mw.menuBar(), (QMenuBar *)mb1);
#ifdef Q_WS_WINCE_WM
QSKIP("With native menubar integration the menubar is not a child", SkipSingle);
#endif
QCOMPARE(mb1->parentWidget(), (QWidget *)&mw); QCOMPARE(mb1->parentWidget(), (QWidget *)&mw);
mw.setMenuBar(0); mw.setMenuBar(0);
@ -633,6 +634,7 @@ void tst_QMainWindow::menuBar()
void tst_QMainWindow::setMenuBar() void tst_QMainWindow::setMenuBar()
{ DEPENDS_ON("menuBar()"); } { DEPENDS_ON("menuBar()"); }
#endif
void tst_QMainWindow::statusBar() void tst_QMainWindow::statusBar()
{ {

View File

@ -419,12 +419,9 @@ void tst_QMenu::overrideMenuAction()
aFileMenu->setMenu(m); //this sets the override menu action for the QMenu aFileMenu->setMenu(m); //this sets the override menu action for the QMenu
QCOMPARE(m->menuAction(), aFileMenu); QCOMPARE(m->menuAction(), aFileMenu);
#ifdef Q_WS_MAC // On Mac and Windows CE, we need to create native key events to test menu
QSKIP("On Mac, we need to create native key events to test menu action activation", SkipAll); // action activation, so skip this part of the test.
#elif defined(Q_OS_WINCE) #if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
QSKIP("On Windows CE, we need to create native key events to test menu action activation", SkipAll);
#endif
QAction *aQuit = new QAction("Quit", &w); QAction *aQuit = new QAction("Quit", &w);
aQuit->setShortcut(QKeySequence("Ctrl+X")); aQuit->setShortcut(QKeySequence("Ctrl+X"));
m->addAction(aQuit); m->addAction(aQuit);
@ -448,6 +445,7 @@ void tst_QMenu::overrideMenuAction()
//after the deletion of the override menu action, //after the deletion of the override menu action,
//the menu should have its default menu action back //the menu should have its default menu action back
QCOMPARE(m->menuAction(), menuaction); QCOMPARE(m->menuAction(), menuaction);
#endif
} }
void tst_QMenu::statusTip() void tst_QMenu::statusTip()

View File

@ -141,8 +141,12 @@ private slots:
void testCleanlooksStyle(); void testCleanlooksStyle();
#endif #endif
void testMacStyle(); void testMacStyle();
#ifdef Q_OS_WINCE
void testWindowsCEStyle(); void testWindowsCEStyle();
#endif
#ifdef Q_OS_WINCE_WM
void testWindowsMobileStyle(); void testWindowsMobileStyle();
#endif
void testStyleFactory(); void testStyleFactory();
void testProxyStyle(); void testProxyStyle();
void pixelMetric(); void pixelMetric();
@ -577,25 +581,21 @@ void tst_QStyle::testCDEStyle()
} }
#endif #endif
#ifdef Q_OS_WINCE
void tst_QStyle::testWindowsCEStyle() void tst_QStyle::testWindowsCEStyle()
{ {
#if defined(Q_OS_WINCE)
QWindowsCEStyle cstyle; QWindowsCEStyle cstyle;
testAllFunctions(&cstyle); testAllFunctions(&cstyle);
#else
QSKIP("No WindowsCEStyle style", SkipAll);
#endif
} }
#endif
#ifdef Q_OS_WINCE_WM
void tst_QStyle::testWindowsMobileStyle() void tst_QStyle::testWindowsMobileStyle()
{ {
#if defined(Q_OS_WINCE_WM)
QWindowsMobileStyle cstyle; QWindowsMobileStyle cstyle;
testAllFunctions(&cstyle); testAllFunctions(&cstyle);
#else
QSKIP("No WindowsMobileStyle style", SkipAll);
#endif
} }
#endif
// Helper class... // Helper class...

View File

@ -181,7 +181,9 @@ private slots:
void palettePropagation(); void palettePropagation();
void palettePropagation2(); void palettePropagation2();
void enabledPropagation(); void enabledPropagation();
#ifndef QT_NO_DRAGANDDROP
void acceptDropsPropagation(); void acceptDropsPropagation();
#endif
void isEnabledTo(); void isEnabledTo();
void visible(); void visible();
void visible_setWindowOpacity(); void visible_setWindowOpacity();
@ -193,26 +195,39 @@ private slots:
void focusChainOnHide(); void focusChainOnHide();
void focusChainOnReparent(); void focusChainOnReparent();
void setTabOrder(); void setTabOrder();
#ifdef Q_WS_WIN
void activation(); void activation();
#endif
void reparent(); void reparent();
#ifndef Q_WS_X11
void windowState(); void windowState();
#endif
void showMaximized(); void showMaximized();
void showFullScreen(); void showFullScreen();
void showMinimized(); void showMinimized();
void showMinimizedKeepsFocus(); void showMinimizedKeepsFocus();
#ifndef Q_WS_QWS
void icon(); void icon();
#endif
void hideWhenFocusWidgetIsChild(); void hideWhenFocusWidgetIsChild();
#ifndef Q_OS_IRIX
void normalGeometry(); void normalGeometry();
#endif
void setGeometry(); void setGeometry();
#ifndef Q_OS_WINCE
void windowOpacity(); void windowOpacity();
#endif
void raise(); void raise();
void lower(); void lower();
#ifndef QT_MAC_USE_COCOA
void stackUnder(); void stackUnder();
#endif
void testContentsPropagation(); void testContentsPropagation();
#ifndef Q_OS_IRIX
void saveRestoreGeometry(); void saveRestoreGeometry();
void restoreVersion1Geometry_data(); void restoreVersion1Geometry_data();
void restoreVersion1Geometry(); void restoreVersion1Geometry();
#endif
void widgetAt(); void widgetAt();
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
@ -251,19 +266,25 @@ private slots:
void scroll(); void scroll();
#endif #endif
// tests QWidget::setGeometry() on windows only #ifndef Q_WS_X11
// tests QWidget::setGeometry()
void setWindowGeometry_data(); void setWindowGeometry_data();
void setWindowGeometry(); void setWindowGeometry();
#endif
// tests QWidget::move() and resize() on windows only #if !defined(Q_WS_X11) && !defined(Q_OS_IRIX)
// tests QWidget::move() and resize()
void windowMoveResize_data(); void windowMoveResize_data();
void windowMoveResize(); void windowMoveResize();
#endif
void moveChild_data(); void moveChild_data();
void moveChild(); void moveChild();
void showAndMoveChild(); void showAndMoveChild();
#ifndef QT_MAC_USE_COCOA
void subtractOpaqueSiblings(); void subtractOpaqueSiblings();
#endif
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
void getDC(); void getDC();
@ -292,7 +313,9 @@ private slots:
void render_task188133(); void render_task188133();
void render_task211796(); void render_task211796();
void render_task217815(); void render_task217815();
#ifndef Q_OS_WINCE
void render_windowOpacity(); void render_windowOpacity();
#endif
void render_systemClip(); void render_systemClip();
void render_systemClip2_data(); void render_systemClip2_data();
void render_systemClip2(); void render_systemClip2();
@ -303,12 +326,16 @@ private slots:
void setContentsMargins(); void setContentsMargins();
#ifndef Q_OS_IRIX
void moveWindowInShowEvent_data(); void moveWindowInShowEvent_data();
void moveWindowInShowEvent(); void moveWindowInShowEvent();
#endif
void repaintWhenChildDeleted(); void repaintWhenChildDeleted();
void hideOpaqueChildWhileHidden(); void hideOpaqueChildWhileHidden();
#if !defined(Q_OS_WINCE) && !defined(Q_WS_QWS)
void updateWhileMinimized(); void updateWhileMinimized();
#endif
#if defined(Q_WS_WIN) || defined(Q_WS_X11) #if defined(Q_WS_WIN) || defined(Q_WS_X11)
void alienWidgets(); void alienWidgets();
#endif #endif
@ -317,7 +344,9 @@ private slots:
void updateGeometry(); void updateGeometry();
void updateGeometry_data(); void updateGeometry_data();
void sendUpdateRequestImmediately(); void sendUpdateRequestImmediately();
#ifndef Q_OS_IRIX
void doubleRepaint(); void doubleRepaint();
#endif
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
void resizeInPaintEvent(); void resizeInPaintEvent();
void opaqueChildren(); void opaqueChildren();
@ -353,7 +382,7 @@ private slots:
void setClearAndResizeMask(); void setClearAndResizeMask();
void maskedUpdate(); void maskedUpdate();
#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_QPA) #if defined(Q_WS_X11) || (defined(Q_WS_WIN) && !defined(Q_OS_WINCE_WM)) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
void syntheticEnterLeave(); void syntheticEnterLeave();
void taskQTBUG_4055_sendSyntheticEnterLeave(); void taskQTBUG_4055_sendSyntheticEnterLeave();
#endif #endif
@ -367,17 +396,23 @@ private slots:
void inputFocus_task257832(); void inputFocus_task257832();
void focusWidget_task254563(); void focusWidget_task254563();
#ifndef Q_OS_WINCE_WM
void rectOutsideCoordinatesLimit_task144779(); void rectOutsideCoordinatesLimit_task144779();
#endif
void setGraphicsEffect(); void setGraphicsEffect();
#ifdef QT_BUILD_INTERNAL
void destroyBackingStore(); void destroyBackingStore();
#endif
void activateWindow(); void activateWindow();
void openModal_taskQTBUG_5804(); void openModal_taskQTBUG_5804();
void focusProxyAndInputMethods(); void focusProxyAndInputMethods();
#ifdef QT_BUILD_INTERNAL
void scrollWithoutBackingStore(); void scrollWithoutBackingStore();
#endif
void taskQTBUG_7532_tabOrderWithFocusProxy(); void taskQTBUG_7532_tabOrderWithFocusProxy();
void movedAndResizedAttributes(); void movedAndResizedAttributes();
@ -1077,11 +1112,10 @@ void tst_QWidget::enabledPropagation()
QVERIFY( !grandChildWidget->isEnabled() ); QVERIFY( !grandChildWidget->isEnabled() );
} }
// Drag'n drop disabled in this build.
#ifndef QT_NO_DRAGANDDROP
void tst_QWidget::acceptDropsPropagation() void tst_QWidget::acceptDropsPropagation()
{ {
#ifdef QT_NO_DRAGANDDROP
QSKIP("Drag'n drop disabled in this build", SkipAll);
#else
QWidget *childWidget = new QWidget(testWidget); QWidget *childWidget = new QWidget(testWidget);
childWidget->show(); childWidget->show();
QVERIFY(!testWidget->acceptDrops()); QVERIFY(!testWidget->acceptDrops());
@ -1115,7 +1149,6 @@ void tst_QWidget::acceptDropsPropagation()
QVERIFY(grandChildWidget->acceptDrops()); QVERIFY(grandChildWidget->acceptDrops());
QVERIFY(grandChildWidget->testAttribute(Qt::WA_DropSiteRegistered)); QVERIFY(grandChildWidget->testAttribute(Qt::WA_DropSiteRegistered));
grandChildWidget->setAcceptDrops(false); grandChildWidget->setAcceptDrops(false);
QVERIFY(!grandChildWidget->testAttribute(Qt::WA_DropSiteRegistered)); QVERIFY(!grandChildWidget->testAttribute(Qt::WA_DropSiteRegistered));
testWidget->setAcceptDrops(true); testWidget->setAcceptDrops(true);
@ -1125,8 +1158,8 @@ void tst_QWidget::acceptDropsPropagation()
QVERIFY(childWidget->acceptDrops()); QVERIFY(childWidget->acceptDrops());
QVERIFY(!grandChildWidget->acceptDrops()); QVERIFY(!grandChildWidget->acceptDrops());
QVERIFY(grandChildWidget->testAttribute(Qt::WA_DropSiteRegistered)); QVERIFY(grandChildWidget->testAttribute(Qt::WA_DropSiteRegistered));
#endif
} }
#endif
void tst_QWidget::isEnabledTo() void tst_QWidget::isEnabledTo()
{ {
@ -1702,11 +1735,9 @@ void tst_QWidget::setTabOrder()
QVERIFY(firstEdit->hasFocus()); QVERIFY(firstEdit->hasFocus());
} }
#ifdef Q_WS_WIN
void tst_QWidget::activation() void tst_QWidget::activation()
{ {
#if !defined(Q_WS_WIN)
QSKIP("This test is Windows-only.", SkipAll);
#endif
Q_CHECK_PAINTEVENTS Q_CHECK_PAINTEVENTS
#if defined(Q_OS_WINCE) #if defined(Q_OS_WINCE)
@ -1751,13 +1782,12 @@ void tst_QWidget::activation()
QTest::qWait(waitTime); QTest::qWait(waitTime);
QVERIFY(qApp->activeWindow() == &widget1); QVERIFY(qApp->activeWindow() == &widget1);
} }
#endif
// Many window managers do not support window state properly, which causes this test to fail.
#ifndef Q_WS_X11
void tst_QWidget::windowState() void tst_QWidget::windowState()
{ {
#ifdef Q_WS_X11
QSKIP("Many window managers do not support window state properly, which causes this "
"test to fail.", SkipAll);
#else
#ifdef Q_OS_WINCE_WM #ifdef Q_OS_WINCE_WM
QPoint pos(500, 500); QPoint pos(500, 500);
QSize size(200, 200); QSize size(200, 200);
@ -1874,8 +1904,8 @@ void tst_QWidget::windowState()
QTRY_COMPARE(widget1.pos(), pos); QTRY_COMPARE(widget1.pos(), pos);
QTRY_COMPARE(widget1.size(), size); QTRY_COMPARE(widget1.size(), size);
#endif
} }
#endif
void tst_QWidget::showMaximized() void tst_QWidget::showMaximized()
{ {
@ -2291,6 +2321,7 @@ void tst_QWidget::reparent()
#endif #endif
QTRY_COMPARE(childTLW.pos(), tlwPos); QTRY_COMPARE(childTLW.pos(), tlwPos);
// This following part of the test only makes sense on Windows.
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
QWidget childTLWChild(&childTLW); QWidget childTLWChild(&childTLW);
childTLWChild.setObjectName("childTLWChild"); childTLWChild.setObjectName("childTLWChild");
@ -2338,16 +2369,13 @@ void tst_QWidget::reparent()
QVERIFY(IsWindow(grandChildTLW.winId())); QVERIFY(IsWindow(grandChildTLW.winId()));
QVERIFY(IsWindow(grandChildTLWChild.winId())); QVERIFY(IsWindow(grandChildTLWChild.winId()));
#else
QSKIP("This test makes only sense on Windows", SkipAll);
#endif #endif
} }
// Qt/Embedded does it differently.
#ifndef Q_WS_QWS
void tst_QWidget::icon() void tst_QWidget::icon()
{ {
#if defined(Q_WS_QWS)
QSKIP("Qt/Embedded does it differently", SkipAll);
#else
QPixmap p(20,20); QPixmap p(20,20);
p.fill(Qt::red); p.fill(Qt::red);
testWidget->setWindowIcon(p); testWidget->setWindowIcon(p);
@ -2359,8 +2387,8 @@ void tst_QWidget::icon()
QVERIFY(!testWidget->windowIcon().isNull()); QVERIFY(!testWidget->windowIcon().isNull());
testWidget->showNormal(); testWidget->showNormal();
QVERIFY(!testWidget->windowIcon().isNull()); QVERIFY(!testWidget->windowIcon().isNull());
#endif
} }
#endif
void tst_QWidget::hideWhenFocusWidgetIsChild() void tst_QWidget::hideWhenFocusWidgetIsChild()
{ {
@ -2400,11 +2428,10 @@ void tst_QWidget::hideWhenFocusWidgetIsChild()
delete parentWidget; delete parentWidget;
} }
// 4DWM issues on IRIX makes this test fail.
#ifndef Q_OS_IRIX
void tst_QWidget::normalGeometry() void tst_QWidget::normalGeometry()
{ {
#ifdef Q_OS_IRIX
QSKIP("4DWM issues on IRIX makes this test fail", SkipAll);
#endif
QWidget parent; QWidget parent;
parent.setWindowTitle("NormalGeometry parent"); parent.setWindowTitle("NormalGeometry parent");
QWidget *child = new QWidget(&parent); QWidget *child = new QWidget(&parent);
@ -2504,7 +2531,7 @@ void tst_QWidget::normalGeometry()
QTest::qWait(10); QTest::qWait(10);
QTRY_COMPARE(parent.normalGeometry(), geom); QTRY_COMPARE(parent.normalGeometry(), geom);
} }
#endif
void tst_QWidget::setGeometry() void tst_QWidget::setGeometry()
{ {
@ -2533,11 +2560,10 @@ void tst_QWidget::setGeometry()
} }
// Windows CE does not support windowOpacity.
#ifndef Q_OS_WINCE
void tst_QWidget::windowOpacity() void tst_QWidget::windowOpacity()
{ {
#ifdef Q_OS_WINCE
QSKIP( "Windows CE does not support windowOpacity", SkipAll);
#endif
QWidget widget; QWidget widget;
QWidget child(&widget); QWidget child(&widget);
@ -2566,6 +2592,7 @@ void tst_QWidget::windowOpacity()
child.setWindowOpacity(-1.0); child.setWindowOpacity(-1.0);
QCOMPARE(child.windowOpacity(), 1.0); QCOMPARE(child.windowOpacity(), 1.0);
} }
#endif
class UpdateWidget : public QWidget class UpdateWidget : public QWidget
{ {
@ -2747,11 +2774,10 @@ void tst_QWidget::raise()
} }
} }
// Cocoa has no Z-Order for views, we hack it, but it results in paint events.
#ifndef QT_MAC_USE_COCOA
void tst_QWidget::lower() void tst_QWidget::lower()
{ {
#ifdef QT_MAC_USE_COCOA
QSKIP("Cocoa has no Z-Order for views, we hack it, but it results in paint events.", SkipAll);
#endif
QWidget *parent = new QWidget(0); QWidget *parent = new QWidget(0);
QList<UpdateWidget *> allChildren; QList<UpdateWidget *> allChildren;
@ -2811,12 +2837,12 @@ void tst_QWidget::lower()
delete parent; delete parent;
} }
#endif
// Cocoa has no Z-Order for views, we hack it, but it results in paint events.
#ifndef QT_MAC_USE_COCOA
void tst_QWidget::stackUnder() void tst_QWidget::stackUnder()
{ {
#ifdef QT_MAC_USE_COCOA
QSKIP("Cocoa has no Z-Order for views, we hack it, but it results in paint events.", SkipAll);
#endif
QTest::qWait(10); QTest::qWait(10);
QWidget *parent = new QWidget(0); QWidget *parent = new QWidget(0);
QList<UpdateWidget *> allChildren; QList<UpdateWidget *> allChildren;
@ -2902,6 +2928,7 @@ void tst_QWidget::stackUnder()
delete parent; delete parent;
} }
#endif
void drawPolygon(QPaintDevice *dev, int w, int h) void drawPolygon(QPaintDevice *dev, int w, int h)
{ {
@ -2974,11 +3001,10 @@ void tst_QWidget::testContentsPropagation()
Test that saving and restoring window geometry with Test that saving and restoring window geometry with
saveGeometry() and restoreGeometry() works. saveGeometry() and restoreGeometry() works.
*/ */
// 4DWM issues on IRIX makes this test fail.
#ifndef Q_OS_IRIX
void tst_QWidget::saveRestoreGeometry() void tst_QWidget::saveRestoreGeometry()
{ {
#ifdef Q_OS_IRIX
QSKIP("4DWM issues on IRIX makes this test fail", SkipAll);
#endif
const QPoint position(100, 100); const QPoint position(100, 100);
const QSize size(200, 200); const QSize size(200, 200);
@ -3105,7 +3131,10 @@ void tst_QWidget::saveRestoreGeometry()
QTRY_COMPARE(widget.geometry(), geom); QTRY_COMPARE(widget.geometry(), geom);
} }
} }
#endif
// 4DWM issues on IRIX makes this test fail.
#ifndef Q_OS_IRIX
void tst_QWidget::restoreVersion1Geometry_data() void tst_QWidget::restoreVersion1Geometry_data()
{ {
QTest::addColumn<QString>("fileName"); QTest::addColumn<QString>("fileName");
@ -3128,10 +3157,6 @@ void tst_QWidget::restoreVersion1Geometry_data()
*/ */
void tst_QWidget::restoreVersion1Geometry() void tst_QWidget::restoreVersion1Geometry()
{ {
#ifdef Q_OS_IRIX
QSKIP("4DWM issues on IRIX makes this test fail", SkipAll);
#endif
QFETCH(QString, fileName); QFETCH(QString, fileName);
QFETCH(uint, expectedWindowState); QFETCH(uint, expectedWindowState);
QFETCH(QPoint, expectedPosition); QFETCH(QPoint, expectedPosition);
@ -3200,8 +3225,8 @@ void tst_QWidget::restoreVersion1Geometry()
f.close(); f.close();
} }
#endif #endif
} }
#endif
void tst_QWidget::widgetAt() void tst_QWidget::widgetAt()
{ {
@ -3844,15 +3869,16 @@ void tst_QWidget::setMinimumSize()
QCOMPARE(w.size(), defaultSize + QSize(200, 200)); QCOMPARE(w.size(), defaultSize + QSize(200, 200));
QVERIFY(!w.testAttribute(Qt::WA_Resized)); QVERIFY(!w.testAttribute(Qt::WA_Resized));
#ifdef Q_OS_WINCE // Setting a minimum size larger than the desktop does not work on WinCE,
QSKIP("Setting a minimum size larger than the desktop does not work", SkipAll); // so skip this part of the test.
#endif #ifndef Q_OS_WINCE
QSize nonDefaultSize = defaultSize + QSize(5,5); QSize nonDefaultSize = defaultSize + QSize(5,5);
w.setMinimumSize(nonDefaultSize); w.setMinimumSize(nonDefaultSize);
w.show(); w.show();
QTest::qWait(50); QTest::qWait(50);
QVERIFY(w.height() >= nonDefaultSize.height()); QVERIFY(w.height() >= nonDefaultSize.height());
QVERIFY(w.width() >= nonDefaultSize.width()); QVERIFY(w.width() >= nonDefaultSize.width());
#endif
} }
void tst_QWidget::setMaximumSize() void tst_QWidget::setMaximumSize()
@ -4541,6 +4567,9 @@ void tst_QWidget::qobject_castInDestroyedSlot()
Q_DECLARE_METATYPE(QList<QRect>) Q_DECLARE_METATYPE(QList<QRect>)
// Since X11 WindowManager operations are all async, and we have no way to know if the window
// manager has finished playing with the window geometry, this test can't be reliable on X11.
#ifndef Q_WS_X11
void tst_QWidget::setWindowGeometry_data() void tst_QWidget::setWindowGeometry_data()
{ {
QTest::addColumn<QList<QRect> >("rects"); QTest::addColumn<QList<QRect> >("rects");
@ -4579,12 +4608,7 @@ void tst_QWidget::setWindowGeometry_data()
<< QRect(100, 50, 200, 0)); << QRect(100, 50, 200, 0));
QList<int> windowFlags; QList<int> windowFlags;
windowFlags << 0 windowFlags << 0 << Qt::FramelessWindowHint;
<< Qt::FramelessWindowHint
#ifdef Q_WS_X11
<< Qt::X11BypassWindowManagerHint
#endif
;
foreach (QList<QRect> l, rects) { foreach (QList<QRect> l, rects) {
QRect rect = l.first(); QRect rect = l.first();
@ -4603,11 +4627,6 @@ void tst_QWidget::setWindowGeometry_data()
void tst_QWidget::setWindowGeometry() void tst_QWidget::setWindowGeometry()
{ {
#ifdef Q_WS_X11
//Since WindowManager operation are all assync, and we have no way to know if the window
// manager has finished playing with the window geometry, this test can't be reliable.
QSKIP("Window Manager behaviour are too random for this test", SkipAll);
#endif
QFETCH(QList<QRect>, rects); QFETCH(QList<QRect>, rects);
QFETCH(int, windowFlags); QFETCH(int, windowFlags);
QRect rect = rects.takeFirst(); QRect rect = rects.takeFirst();
@ -4728,6 +4747,7 @@ void tst_QWidget::setWindowGeometry()
QTRY_COMPARE(widget.geometry(), rect); QTRY_COMPARE(widget.geometry(), rect);
} }
} }
#endif
#if defined (Q_WS_WIN) && !defined(Q_OS_WINCE) #if defined (Q_WS_WIN) && !defined(Q_OS_WINCE)
void tst_QWidget::setGeometry_win() void tst_QWidget::setGeometry_win()
@ -4748,6 +4768,10 @@ void tst_QWidget::setGeometry_win()
} }
#endif #endif
// Since X11 WindowManager operation are all async, and we have no way to know if the window
// manager has finished playing with the window geometry, this test can't be reliable on X11.
// 4DWM issues on IRIX also makes this test fail.
#if !defined(Q_WS_X11) && !defined(Q_OS_IRIX)
void tst_QWidget::windowMoveResize_data() void tst_QWidget::windowMoveResize_data()
{ {
setWindowGeometry_data(); setWindowGeometry_data();
@ -4755,14 +4779,6 @@ void tst_QWidget::windowMoveResize_data()
void tst_QWidget::windowMoveResize() void tst_QWidget::windowMoveResize()
{ {
#ifdef Q_WS_X11
//Since WindowManager operation are all assync, and we have no way to know if the window
// manager has finished playing with the window geometry, this test can't be reliable.
QSKIP("Window Manager behaviour are too random for this test", SkipAll);
#endif
#ifdef Q_OS_IRIX
QSKIP("4DWM issues on IRIX makes this test fail", SkipAll);
#endif
QFETCH(QList<QRect>, rects); QFETCH(QList<QRect>, rects);
QFETCH(int, windowFlags); QFETCH(int, windowFlags);
@ -4945,6 +4961,7 @@ void tst_QWidget::windowMoveResize()
QTRY_COMPARE(widget.size(), rect.size()); QTRY_COMPARE(widget.size(), rect.size());
} }
} }
#endif
class ColorWidget : public QWidget class ColorWidget : public QWidget
{ {
@ -5088,11 +5105,10 @@ void tst_QWidget::showAndMoveChild()
VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), Qt::red); VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), Qt::red);
} }
// Cocoa only has rect granularity.
#ifndef QT_MAC_USE_COCOA
void tst_QWidget::subtractOpaqueSiblings() void tst_QWidget::subtractOpaqueSiblings()
{ {
#ifdef QT_MAC_USE_COCOA
QSKIP("Cocoa only has rect granularity.", SkipAll);
#else
QWidget w; QWidget w;
w.setGeometry(50, 50, 300, 300); w.setGeometry(50, 50, 300, 300);
@ -5124,8 +5140,8 @@ void tst_QWidget::subtractOpaqueSiblings()
QTRY_COMPARE(medium->r.translated(medium->mapTo(&w, QPoint())), QTRY_COMPARE(medium->r.translated(medium->mapTo(&w, QPoint())),
QRegion(medium->geometry().translated(large->pos())) QRegion(medium->geometry().translated(large->pos()))
- tall->geometry()); - tall->geometry());
#endif
} }
#endif
void tst_QWidget::deleteStyle() void tst_QWidget::deleteStyle()
{ {
@ -5568,10 +5584,8 @@ void tst_QWidget::setToolTip()
QCOMPARE(widget.toolTip(), QString()); QCOMPARE(widget.toolTip(), QString());
QCOMPARE(spy.count(), 2); QCOMPARE(spy.count(), 2);
#ifdef Q_OS_WINCE_WM // Mouse over doesn't work on Windows mobile, so skip the rest of the test for that platform.
QSKIP("Mouse over doesn't work on Windows mobile.", SkipAll); #ifndef Q_OS_WINCE_WM
#endif
for (int pass = 0; pass < 2; ++pass) { for (int pass = 0; pass < 2; ++pass) {
QWidget *popup = new QWidget(0, Qt::Popup); QWidget *popup = new QWidget(0, Qt::Popup);
popup->resize(150, 50); popup->resize(150, 50);
@ -5596,6 +5610,7 @@ void tst_QWidget::setToolTip()
QTest::mouseMove(popup); QTest::mouseMove(popup);
delete popup; delete popup;
} }
#endif
} }
void tst_QWidget::testWindowIconChangeEventPropagation() void tst_QWidget::testWindowIconChangeEventPropagation()
@ -6564,12 +6579,10 @@ void tst_QWidget::render_task217815()
QCOMPARE(widget.size(), explicitSize); QCOMPARE(widget.size(), explicitSize);
} }
// Window Opacity is not supported on Windows CE.
#ifndef Q_OS_WINCE
void tst_QWidget::render_windowOpacity() void tst_QWidget::render_windowOpacity()
{ {
#ifdef Q_OS_WINCE
QSKIP("Window Opacity is not supported on Windows CE", SkipAll);
#endif
const qreal opacity = 0.5; const qreal opacity = 0.5;
{ // Check that the painter opacity effects the widget drawing. { // Check that the painter opacity effects the widget drawing.
@ -6641,6 +6654,7 @@ void tst_QWidget::render_windowOpacity()
QCOMPARE(result, expected); QCOMPARE(result, expected);
} }
} }
#endif
void tst_QWidget::render_systemClip() void tst_QWidget::render_systemClip()
{ {
@ -7047,6 +7061,8 @@ void tst_QWidget::setContentsMargins()
QCOMPARE(newSize, label3.sizeHint()); QCOMPARE(newSize, label3.sizeHint());
} }
// 4DWM issues on IRIX makes this test fail.
#ifndef Q_OS_IRIX
void tst_QWidget::moveWindowInShowEvent_data() void tst_QWidget::moveWindowInShowEvent_data()
{ {
QTest::addColumn<QPoint>("initial"); QTest::addColumn<QPoint>("initial");
@ -7060,9 +7076,6 @@ void tst_QWidget::moveWindowInShowEvent_data()
void tst_QWidget::moveWindowInShowEvent() void tst_QWidget::moveWindowInShowEvent()
{ {
#ifdef Q_OS_IRIX
QSKIP("4DWM issues on IRIX makes this test fail", SkipAll);
#endif
QFETCH(QPoint, initial); QFETCH(QPoint, initial);
QFETCH(QPoint, position); QFETCH(QPoint, position);
@ -7094,6 +7107,7 @@ void tst_QWidget::moveWindowInShowEvent()
// it should have moved // it should have moved
QCOMPARE(widget.pos(), position); QCOMPARE(widget.pos(), position);
} }
#endif
void tst_QWidget::repaintWhenChildDeleted() void tst_QWidget::repaintWhenChildDeleted()
{ {
@ -7170,12 +7184,10 @@ void tst_QWidget::hideOpaqueChildWhileHidden()
QCOMPARE(child2.r, QRegion()); QCOMPARE(child2.r, QRegion());
} }
// This test doesn't make sense without support for showMinimized().
#if !defined(Q_OS_WINCE) && !defined(Q_WS_QWS)
void tst_QWidget::updateWhileMinimized() void tst_QWidget::updateWhileMinimized()
{ {
#if defined(Q_OS_WINCE) || defined(Q_WS_QWS)
QSKIP("This test doesn't make sense without support for showMinimized()", SkipAll);
#endif
UpdateWidget widget; UpdateWidget widget;
// Filter out activation change and focus events to avoid update() calls in QWidget. // Filter out activation change and focus events to avoid update() calls in QWidget.
widget.updateOnActivationChangeAndFocusIn = false; widget.updateOnActivationChangeAndFocusIn = false;
@ -7204,6 +7216,7 @@ void tst_QWidget::updateWhileMinimized()
QTRY_COMPARE(widget.numPaintEvents, 1); QTRY_COMPARE(widget.numPaintEvents, 1);
QCOMPARE(widget.paintedRegion, QRegion(0, 0, 50, 50)); QCOMPARE(widget.paintedRegion, QRegion(0, 0, 50, 50));
} }
#endif
#if defined(Q_WS_WIN) || defined(Q_WS_X11) #if defined(Q_WS_WIN) || defined(Q_WS_X11)
class PaintOnScreenWidget: public QWidget class PaintOnScreenWidget: public QWidget
@ -7687,11 +7700,11 @@ void tst_QWidget::sendUpdateRequestImmediately()
QCOMPARE(updateWidget.numUpdateRequestEvents, 1); QCOMPARE(updateWidget.numUpdateRequestEvents, 1);
} }
// 4DWM issues on IRIX makes this test fail.
#ifndef Q_OS_IRIX
void tst_QWidget::doubleRepaint() void tst_QWidget::doubleRepaint()
{ {
#ifdef Q_OS_IRIX #if defined(Q_WS_MAC)
QSKIP("4DWM issues on IRIX makes this test fail", SkipAll);
#elif defined(Q_WS_MAC)
if (!macHasAccessToWindowsServer()) if (!macHasAccessToWindowsServer())
QSKIP("Not having window server access causes the wrong number of repaints to be issues", SkipAll); QSKIP("Not having window server access causes the wrong number of repaints to be issues", SkipAll);
#endif #endif
@ -7720,6 +7733,7 @@ void tst_QWidget::doubleRepaint()
QTest::qWait(10); QTest::qWait(10);
QCOMPARE(widget.numPaintEvents, 0); QCOMPARE(widget.numPaintEvents, 0);
} }
#endif
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
// This test only makes sense on the Mac when passing -graphicssystem. // This test only makes sense on the Mac when passing -graphicssystem.
@ -8637,7 +8651,8 @@ void tst_QWidget::maskedUpdate()
QTRY_COMPARE(grandChild.paintedRegion, QRegion(grandChild.rect())); // Full update. QTRY_COMPARE(grandChild.paintedRegion, QRegion(grandChild.rect())); // Full update.
} }
#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_QPA) // Windows Mobile has no proper cursor support, so skip this test on that platform.
#if defined(Q_WS_X11) || (defined(Q_WS_WIN) && !defined(Q_OS_WINCE_WM)) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
void tst_QWidget::syntheticEnterLeave() void tst_QWidget::syntheticEnterLeave()
{ {
class MyWidget : public QWidget class MyWidget : public QWidget
@ -8693,10 +8708,6 @@ void tst_QWidget::syntheticEnterLeave()
QCursor::setPos(globalPos); // Enter child2 and grandChild. QCursor::setPos(globalPos); // Enter child2 and grandChild.
QTest::qWait(300); QTest::qWait(300);
#ifdef Q_OS_WINCE_WM
QSKIP("Windows Mobile has no proper cursor support", SkipAll);
#endif
QCOMPARE(window.numLeaveEvents, 0); QCOMPARE(window.numLeaveEvents, 0);
QCOMPARE(child2->numLeaveEvents, 0); QCOMPARE(child2->numLeaveEvents, 0);
QCOMPARE(grandChild->numLeaveEvents, 0); QCOMPARE(grandChild->numLeaveEvents, 0);
@ -8743,12 +8754,12 @@ void tst_QWidget::syntheticEnterLeave()
QCOMPARE(window.numEnterEvents, 0); QCOMPARE(window.numEnterEvents, 0);
QCOMPARE(child1->numEnterEvents, 1); QCOMPARE(child1->numEnterEvents, 1);
} }
#endif
// Windows Mobile has no proper cursor support, so skip this test on that platform.
#if defined(Q_WS_X11) || (defined(Q_WS_WIN) && !defined(Q_OS_WINCE_WM)) || defined(Q_WS_QWS) || defined(Q_WS_QPA)
void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave() void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
{ {
#ifdef Q_OS_WINCE_WM
QSKIP("Windows Mobile has no proper cursor support", SkipAll);
#endif
class SELParent : public QWidget class SELParent : public QWidget
{ {
public: public:
@ -8958,9 +8969,10 @@ void tst_QWidget::focusWidget_task254563()
QVERIFY(top.focusWidget() != widget); //dangling pointer QVERIFY(top.focusWidget() != widget); //dangling pointer
} }
// This test case relies on developer build (AUTOTEST_EXPORT).
#ifdef QT_BUILD_INTERNAL
void tst_QWidget::destroyBackingStore() void tst_QWidget::destroyBackingStore()
{ {
#ifdef QT_BUILD_INTERNAL
UpdateWidget w; UpdateWidget w;
w.reset(); w.reset();
w.show(); w.show();
@ -8983,10 +8995,8 @@ void tst_QWidget::destroyBackingStore()
w.update(); w.update();
QApplication::processEvents(); QApplication::processEvents();
QCOMPARE(w.numPaintEvents, 2); QCOMPARE(w.numPaintEvents, 2);
#else
QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll);
#endif
} }
#endif
// Helper function // Helper function
QWidgetBackingStore* backingStore(QWidget &widget) QWidgetBackingStore* backingStore(QWidget &widget)
@ -8999,11 +9009,10 @@ QWidgetBackingStore* backingStore(QWidget &widget)
return backingStore; return backingStore;
} }
// Tables of 5000 elements do not make sense on Windows Mobile.
#ifndef Q_OS_WINCE_WM
void tst_QWidget::rectOutsideCoordinatesLimit_task144779() void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
{ {
#ifdef Q_OS_WINCE_WM
QSKIP( "Tables of 5000 elements do not make sense on Windows Mobile.", SkipAll);
#endif
QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs
QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame
QPalette palette; QPalette palette;
@ -9038,6 +9047,7 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
correct.toImage().convertToFormat(QImage::Format_RGB32)); correct.toImage().convertToFormat(QImage::Format_RGB32));
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }
#endif
void tst_QWidget::inputFocus_task257832() void tst_QWidget::inputFocus_task257832()
{ {
@ -9235,9 +9245,10 @@ public:
}; };
#endif #endif
// Test case relies on developer build (AUTOTEST_EXPORT).
#ifdef QT_BUILD_INTERNAL
void tst_QWidget::scrollWithoutBackingStore() void tst_QWidget::scrollWithoutBackingStore()
{ {
#ifdef QT_BUILD_INTERNAL
scrollWidgetWBS scrollable; scrollWidgetWBS scrollable;
scrollable.resize(100,100); scrollable.resize(100,100);
QLabel child(QString("@"),&scrollable); QLabel child(QString("@"),&scrollable);
@ -9251,10 +9262,8 @@ void tst_QWidget::scrollWithoutBackingStore()
QCOMPARE(child.pos(),QPoint(25,25)); QCOMPARE(child.pos(),QPoint(25,25));
scrollable.enableBackingStore(); scrollable.enableBackingStore();
QCOMPARE(child.pos(),QPoint(25,25)); QCOMPARE(child.pos(),QPoint(25,25));
#else
QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll);
#endif
} }
#endif
void tst_QWidget::taskQTBUG_7532_tabOrderWithFocusProxy() void tst_QWidget::taskQTBUG_7532_tabOrderWithFocusProxy()
{ {

View File

@ -97,8 +97,10 @@ private slots:
void setOption_HaveHelpButton(); void setOption_HaveHelpButton();
void setOption_HelpButtonOnRight(); void setOption_HelpButtonOnRight();
void setOption_HaveCustomButtonX(); void setOption_HaveCustomButtonX();
#ifndef Q_OS_WINCE
void combinations_data(); void combinations_data();
void combinations(); void combinations();
#endif
void showCurrentPageOnly(); void showCurrentPageOnly();
void setButtonText(); void setButtonText();
void setCommitPage(); void setCommitPage();
@ -2018,6 +2020,8 @@ public:
} }
}; };
// Too much memory usage for testing on CE emulator.
#ifndef Q_OS_WINCE
void tst_QWizard::combinations_data() void tst_QWizard::combinations_data()
{ {
CombinationsTestData combTestData; CombinationsTestData combTestData;
@ -2029,10 +2033,6 @@ void tst_QWizard::combinations_data()
void tst_QWizard::combinations() void tst_QWizard::combinations()
{ {
#ifdef Q_OS_WINCE
QSKIP("Too much memory usage for testing on CE emulator", SkipAll);
#endif
QFETCH(bool, ref); QFETCH(bool, ref);
QFETCH(bool, testEquality); QFETCH(bool, testEquality);
QFETCH(QList<Operation *>, operations); QFETCH(QList<Operation *>, operations);
@ -2083,6 +2083,7 @@ void tst_QWizard::combinations()
QVERIFY(false); QVERIFY(false);
} }
} }
#endif
class WizardPage : public QWizardPage class WizardPage : public QWizardPage
{ {

View File

@ -144,8 +144,10 @@ private slots:
void mapRectToScene(); void mapRectToScene();
void mapRectFromScene_data(); void mapRectFromScene_data();
void mapRectFromScene(); void mapRectFromScene();
#ifndef Q_WS_WINCE_WM
void chipTester_data(); void chipTester_data();
void chipTester(); void chipTester();
#endif
void deepNesting_data(); void deepNesting_data();
void deepNesting(); void deepNesting();
void imageRiver_data(); void imageRiver_data();
@ -395,6 +397,8 @@ void tst_QGraphicsView::mapRectFromScene()
} }
} }
// This test does not make sense Windows Mobile without OpenGL
#ifndef Q_WS_WINCE_WM
void tst_QGraphicsView::chipTester_data() void tst_QGraphicsView::chipTester_data()
{ {
QTest::addColumn<bool>("antialias"); QTest::addColumn<bool>("antialias");
@ -416,9 +420,6 @@ void tst_QGraphicsView::chipTester_data()
void tst_QGraphicsView::chipTester() void tst_QGraphicsView::chipTester()
{ {
#ifdef Q_WS_WINCE_WM
QSKIP("WinCE WM: Fails on Windows Mobile w/o OpenGL", SkipAll);
#endif
QFETCH(bool, antialias); QFETCH(bool, antialias);
QFETCH(bool, opengl); QFETCH(bool, opengl);
QFETCH(int, operation); QFETCH(int, operation);
@ -436,6 +437,7 @@ QSKIP("WinCE WM: Fails on Windows Mobile w/o OpenGL", SkipAll);
tester.runBenchmark(); tester.runBenchmark();
} }
} }
#endif
static void addChildHelper(QGraphicsItem *parent, int n, bool rotate) static void addChildHelper(QGraphicsItem *parent, int n, bool rotate)
{ {

View File

@ -74,7 +74,9 @@ public slots:
void cleanup(); void cleanup();
private slots: private slots:
void ipv4LoopbackPerformanceTest(); void ipv4LoopbackPerformanceTest();
#ifndef Q_WS_WINCE_WM
void ipv6LoopbackPerformanceTest(); void ipv6LoopbackPerformanceTest();
#endif
void ipv4PerformanceTest(); void ipv4PerformanceTest();
}; };
@ -165,14 +167,13 @@ void tst_QTcpServer::ipv4LoopbackPerformanceTest()
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// IPv6 loopback not yet supported on Windows Mobile
#ifndef Q_WS_WINCE_WM
void tst_QTcpServer::ipv6LoopbackPerformanceTest() void tst_QTcpServer::ipv6LoopbackPerformanceTest()
{ {
QFETCH_GLOBAL(bool, setProxy); QFETCH_GLOBAL(bool, setProxy);
if (setProxy) if (setProxy)
return; return;
#if defined(Q_WS_WINCE_WM)
QSKIP("WinCE WM: Not yet supported", SkipAll);
#endif
QTcpServer server; QTcpServer server;
if (!server.listen(QHostAddress::LocalHostIPv6, 0)) { if (!server.listen(QHostAddress::LocalHostIPv6, 0)) {
@ -217,6 +218,7 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest()
delete clientB; delete clientB;
} }
} }
#endif
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
void tst_QTcpServer::ipv4PerformanceTest() void tst_QTcpServer::ipv4PerformanceTest()