void qtimerList();
void containerTypedefs();
void forwardDeclared();
+#if defined(Q_ALIGNOF) && defined(Q_DECL_ALIGN)
void alignment();
+#endif
void QTBUG13079_collectionInsideCollection();
void foreach_2();
testAssociativeContainerAlignment<QHash<Aligned128, Aligned4> >();
testAssociativeContainerAlignment<QHash<Aligned128, Aligned128> >();
}
-
-#else
-void tst_Collections::alignment()
-{
- QSKIP("Compiler doesn't support necessary extension keywords", SkipAll);
-}
#endif
#ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
void httpServerFiles();
void httpServerCGI_data();
void httpServerCGI();
+#ifndef QT_NO_OPENSSL
void httpsServer();
+#endif
void httpProxy();
void httpProxyBasicAuth();
void httpProxyNtlmAuth();
netChat(80, chat);
}
+#ifndef QT_NO_OPENSSL
void tst_NetworkSelfTest::httpsServer()
{
-#ifndef QT_NO_OPENSSL
netChat(443, QList<Chat>()
<< Chat::StartEncryption
<< Chat::send("GET / HTTP/1.0\r\n"
<< Chat::discardUntil(" ")
<< Chat::expect("200 ")
<< Chat::DiscardUntilDisconnect);
-#else
- QSKIP("SSL not enabled, cannot test", SkipAll);
-#endif
}
+#endif
void tst_NetworkSelfTest::httpProxy()
{
void itemListPosition();
void separatorItem_data();
void separatorItem();
+#ifndef QT_NO_STYLE_CLEANLOOKS
void task190351_layout();
void task191329_size();
+#endif
void task166349_setEditableOnReturn();
void task190205_setModelAdjustToContents();
void task248169_popupWithMinimalSize();
void task253944_itemDelegateIsReset();
void subControlRectsWithOffset_data();
void subControlRectsWithOffset();
+#ifndef QT_NO_STYLE_WINDOWS
void task260974_menuItemRectangleForComboBoxPopup();
+#endif
void removeItem();
void resetModel();
void keyBoardNavigationWithMouse();
}
}
-
+// Apps running with valgrind are not fast enough.
void tst_QComboBox::virtualAutocompletion()
{
testWidget->clear();
qApp->processEvents(); // Process events to trigger autocompletion
QTRY_VERIFY(testWidget->currentIndex() == 1);
-#ifdef QTEST_RUNNING_USING_VALGRIND
- QSKIP("App running with valgrind are not fast enough", SkipAll);
-#endif
-
QKeyEvent kp2(QEvent::KeyPress, Qt::Key_O, 0, "o");
QKeyEvent kr2(QEvent::KeyRelease, Qt::Key_O, 0, "o");
}
}
+// This test requires the Cleanlooks style
+#ifndef QT_NO_STYLE_CLEANLOOKS
void tst_QComboBox::task190351_layout()
{
-#ifndef QT_NO_STYLE_CLEANLOOKS
const QString oldStyle = QApplication::style()->objectName();
QApplication::setStyle(new QCleanlooksStyle);
#endif
QApplication::setStyle(oldStyle);
-#else
- QSKIP("Qt configured without cleanlooks style", SkipAll);
-#endif
}
+#endif
class task166349_ComboBox : public QComboBox
{
QCOMPARE(QLatin1String("two1"), comboBox.itemText(comboBox.count() - 1));
}
+// This test requires the Cleanlooks style.
+#ifndef QT_NO_STYLE_CLEANLOOKS
void tst_QComboBox::task191329_size()
{
-#ifndef QT_NO_STYLE_CLEANLOOKS
const QString oldStyle = QApplication::style()->objectName();
QApplication::setStyle(new QCleanlooksStyle);
#endif
QApplication::setStyle(oldStyle);
-#else
- QSKIP("Qt configured without cleanlooks style", SkipAll);
-#endif
}
+#endif
void tst_QComboBox::task190205_setModelAdjustToContents()
{
}
+// This test depends on Windows style.
+#ifndef QT_NO_STYLE_WINDOWS
void tst_QComboBox::task260974_menuItemRectangleForComboBoxPopup()
{
-#ifdef QT_NO_STYLE_WINDOWS
- QSKIP("test depends on windows style", QTest::SkipAll);
-#else
class TestStyle: public QWindowsStyle
{
public:
QTRY_VERIFY(style.discoveredRect.width() <= comboBox.width());
}
-#endif
}
+#endif
void tst_QComboBox::removeItem()
{
QCOMPARE(combo.currentText(), QLatin1String("0"));
-#ifdef Q_OS_WINCE
- QSKIP("When calling cursor function, Windows CE responds with: This function is not supported on this system.", SkipAll);
-#endif
-
+ // When calling cursor function, Windows CE responds with: This function is not supported on this system.
+#ifndef Q_OS_WINCE
// Force cursor movement to prevent QCursor::setPos() from returning prematurely on QPA:
const QPoint target(combo.view()->mapToGlobal(combo.view()->rect().center()));
QCursor::setPos(QPoint(target.x() + 1, target.y()));
QTest::keyClick(combo.view(), Qt::Key_Enter);
QTRY_COMPARE(combo.currentText(), QString::number(final));
+#endif
}
void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated()
void showMaximized();
void showMinimized();
void showFullScreen();
+#if !defined(Q_WS_X11) && !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();
dialog.showMaximized();
QVERIFY(dialog.isMaximized());
QVERIFY(dialog.isVisible());
-#if !defined(Q_WS_MAC) && !defined(Q_OS_IRIX) && !defined(Q_OS_HPUX)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_IRIX) && !defined(Q_OS_HPUX)
QVERIFY(!sizeGrip->isVisible());
#endif
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_WS_X11) && !defined(Q_OS_WINCE)
void tst_QDialog::showAsTool()
{
-#if defined(Q_WS_X11)
- QSKIP("Qt/X11: Skipped since activeWindow() is not respected by all window managers", SkipAll);
-#elif defined(Q_OS_WINCE)
- QSKIP("No real support for Qt::Tool on WinCE", SkipAll);
-#endif
ToolDialog dialog(testWidget);
testWidget->activateWindow();
dialog.exec();
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", SkipAll);
-#endif
QDialog dialog(0, Qt::Tool);
dialog.move(QPoint(100,100));
const QPoint beforeShowPosition = dialog.pos();
const QPoint afterShowPosition = dialog.pos();
QCOMPARE(afterShowPosition, beforeShowPosition);
}
+#endif
class Dialog : public QDialog
{
QCOMPARE(dialog->exec(), int(QDialog::Rejected));
}
-#ifndef QT_NO_EXCEPTIONS
+// 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_))
class QDialogTestException : public std::exception { };
class ExceptionDialog : public QDialog
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.", SkipAll);
-#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.
}
QCOMPARE(caughtExceptions, 1);
}
-#else
-void tst_QDialog::throwInExec()
-{
- QSKIP("Exceptions are disabled", SkipAll);
-}
-#endif //QT_NO_EXCEPTIONS
+#endif
// From Task 124269
void tst_QDialog::showSizeGrip()
void initTestCase();
void setGeometry_data();
void setGeometry();
+#ifndef QT_NO_PROCESS
void regionSynchronization();
+#endif
void reservedSynchronous();
private:
VERIFY_COLOR(rect, bgColor);
}
+#ifndef QT_NO_PROCESS
void tst_QDirectPainter::regionSynchronization()
{
-#ifdef QT_NO_PROCESS
- QSKIP("Test requires QProcess", SkipAll);
-#else
QRect dpRect(10, 10, 50, 50);
// Start the direct painter in a different process
QVERIFY(i > 100); // sanity check
proc.kill();
-#endif
}
+#endif
class MyObject : public QObject
{
void filePath();
+#ifdef Q_OS_UNIX
void hidden();
+#endif
void fileName();
void fileName_data();
QVERIFY(rowsAboutToBeRemoved_cleanup(test_path));
}
+#ifdef Q_OS_UNIX
void tst_QDirModel::hidden()
{
-#ifdef Q_OS_UNIX
QDir current;
current.mkdir(".qtest_hidden");
model2.setFilter(model2.filter() | QDir::Hidden);
index = model2.index(QDir::currentPath() + "/.qtest_hidden");
QVERIFY(index.isValid());
-#else
- QSKIP("Test not implemented on non-Unixes", SkipAll);
-#endif
}
+#endif
void tst_QDirModel::fileName_data()
{
}
#if 0
+#ifdef Q_OS_UNIX
void tst_QDirModel::unreadable()
{
-#ifdef Q_OS_UNIX
//QFile current("qtest_unreadable");
//QVERIFY(current.setPermissions(QFile::WriteOwner));
model2.setFilter(model2.filter() | QDir::Hidden);
index = model2.index(QDir::currentPath() + "/qtest_unreadable");
QVERIFY(index.isValid());
-#else
- QSKIP("Test not implemented on non-Unixes", SkipAll);
-#endif
}
#endif
+#endif
void tst_QDirModel::filePath()
{
void clearLineEdit();
void enableChooseButton();
void hooks();
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && defined(QT_BUILD_INTERNAL)
void tildeExpansion_data();
void tildeExpansion();
#endif
QCOMPARE(QFileDialog::getSaveFileName(), QString("saveName"));
}
-#ifdef Q_OS_UNIX
+// Test case relies on developer build (AUTOTEST_EXPORT).
+#if defined(Q_OS_UNIX) && defined(QT_BUILD_INTERNAL)
void tst_QFiledialog::tildeExpansion_data()
{
QTest::addColumn<QString>("tildePath");
QTest::newRow("invalid user name") << invalid << invalid;
}
-
void tst_QFiledialog::tildeExpansion()
{
-#ifndef QT_BUILD_INTERNAL
- QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll);
-#else
QFETCH(QString, tildePath);
QFETCH(QString, expandedPath);
QCOMPARE(qt_tildeExpansion(tildePath), expandedPath);
-#endif
}
#endif
private slots:
void checkReason_Tab();
void checkReason_ShiftTab();
+#ifndef Q_OS_WIN32
void checkReason_BackTab();
+#endif
void checkReason_Popup();
void checkReason_focusWidget();
void checkReason_Shortcut();
/*!
In this test we verify that the Qt::KeyBacktab key is handled in a qfocusevent
*/
+// Backtab is not supported on Windows.
+#ifndef Q_OS_WIN32
void tst_QFocusEvent::checkReason_BackTab()
{
-#ifdef Q_OS_WIN32 // key is not supported on Windows
- QSKIP( "Backtab is not supported on Windows", SkipAll );
-#else
initWidget();
QVERIFY( childFocusWidgetOne->hasFocus() );
QVERIFY( childFocusWidgetTwo->hasFocus() );
QCOMPARE( childFocusWidgetOne->focusOutEventReason, int(Qt::BacktabFocusReason) );
QCOMPARE( childFocusWidgetTwo->focusInEventReason, int(Qt::BacktabFocusReason) );
-#endif
}
+#endif
void tst_QFocusEvent::checkReason_Popup()
{
void qgraphicsgridlayout();
void addItem_data();
void addItem();
+#ifndef Q_WS_MAC
void alignment_data();
void alignment();
+#endif
void alignment2();
void alignment2_data();
+#ifndef Q_WS_MAC
void columnAlignment_data();
void columnAlignment();
+#endif
void columnCount_data();
void columnCount();
void columnMaximumWidth_data();
delete layout;
}
+// Resizing a QGraphicsWidget to effectiveSizeHint(Qt::MaximumSize) is currently not supported on mac.
+#ifndef Q_WS_MAC
void tst_QGraphicsGridLayout::alignment_data()
{
QTest::addColumn<bool>("hasHeightForWidth");
// public Qt::Alignment alignment(QGraphicsLayoutItem* item) const
void tst_QGraphicsGridLayout::alignment()
{
-#ifdef Q_WS_MAC
- QSKIP("Resizing a QGraphicsWidget to effectiveSizeHint(Qt::MaximumSize) is currently not supported on mac", SkipAll);
-#endif
QFETCH(bool, hasHeightForWidth);
QGraphicsScene scene;
QGraphicsView view(&scene);
delete widget;
}
+#endif
+// Resizing a QGraphicsWidget to effectiveSizeHint(Qt::MaximumSize) is currently not supported on mac.
+#ifndef Q_WS_MAC
void tst_QGraphicsGridLayout::columnAlignment_data()
{
QTest::addColumn<bool>("hasHeightForWidth");
// public Qt::Alignment columnAlignment(int column) const
void tst_QGraphicsGridLayout::columnAlignment()
{
-#ifdef Q_WS_MAC
- QSKIP("Resizing a QGraphicsWidget to effectiveSizeHint(Qt::MaximumSize) is currently not supported on mac", SkipAll);
-#endif
QFETCH(bool, hasHeightForWidth);
QGraphicsScene scene;
QGraphicsView view(&scene);
delete widget;
}
+#endif
void tst_QGraphicsGridLayout::columnCount_data()
{
{
QFETCH(qreal, totalSize);
QFETCH(IntList, stretches);
- //QSKIP("Seems to be some problems with stretch factors. Talk with Jasmin", SkipAll);
QGraphicsScene scene;
QGraphicsView view(&scene);
QGraphicsWidget *widget = new QGraphicsWidget(0, Qt::Window);
void focusNextPrevChild();
void focusOutEvent_data();
void focusOutEvent();
+#if !defined(Q_OS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR))
void hoverEnterLeaveEvent_data();
void hoverEnterLeaveEvent();
+#endif
void hoverMoveEvent_data();
void hoverMoveEvent();
void keyPressEvent_data();
void setFocus_complexTwoWidgets();
void popup_basic();
void popup_subwidget();
+#if !defined(QT_NO_CURSOR) && (!defined(Q_OS_WINCE) || defined(GWES_ICONCURS))
void changingCursor_basic();
+#endif
void tooltip_basic();
void childPos_data();
void childPos();
}
};
+// protected void hoverEnterEvent(QGraphicsSceneHoverEvent* event)
+#if !defined(Q_OS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR))
void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent_data()
{
QTest::addColumn<bool>("hasWidget");
QTest::newRow("no widget, hover") << false << true;
}
-// protected void hoverEnterEvent(QGraphicsSceneHoverEvent* event)
void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
{
QFETCH(bool, hasWidget);
QFETCH(bool, hoverEnabled);
-#if defined(Q_OS_WINCE) && (!defined(GWES_ICONCURS) || defined(QT_NO_CURSOR))
- QSKIP("hover events not supported on this platform", SkipAll);
-#endif
-
// proxy should translate this into events that the widget would expect
QGraphicsScene scene;
if (!hasWidget)
delete widget;
}
+#endif
void tst_QGraphicsProxyWidget::hoverMoveEvent_data()
{
QCOMPARE(popup->size(), child->size().toSize());
}
+#if !defined(QT_NO_CURSOR) && (!defined(Q_OS_WINCE) || defined(GWES_ICONCURS))
void tst_QGraphicsProxyWidget::changingCursor_basic()
{
-#if defined(Q_OS_WINCE) && (!defined(GWES_ICONCURS) || defined(QT_NO_CURSOR))
- QSKIP("hover events not supported on this platform", SkipAll);
-#endif
-#ifndef QT_NO_CURSOR
// Confirm that mouse events are working properly by checking that
// when moving the mouse over a line edit it will change the cursor into the I
QGraphicsScene scene;
QTest::mouseMove(view.viewport(), QPoint(1, 1));
sendMouseMove(view.viewport(), QPoint(1, 1));
QTRY_COMPARE(view.viewport()->cursor().shape(), Qt::ArrowCursor);
-#endif
}
+#endif
void tst_QGraphicsProxyWidget::tooltip_basic()
{
void addPixmap();
void addRect();
void addText();
+#if !defined(Q_OS_WINCE) || defined(GWES_ICONCURS)
void removeItem();
+#endif
void clear();
void focusItem();
void focusItemLostFocus();
QCOMPARE(text->font(), QFont());
}
+#if !defined(Q_OS_WINCE) || defined(GWES_ICONCURS)
void tst_QGraphicsScene::removeItem()
{
-#if defined(Q_OS_WINCE) && !defined(GWES_ICONCURS)
- QSKIP("No mouse cursor support", SkipAll);
-#endif
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(0, 0, 10, 10));
QCOMPARE(scene.itemAt(0, 0), item); // forces indexing
qApp->processEvents(); // <- pending update is sent to view
QVERIFY(!hoverItem->isHovered);
}
+#endif
void tst_QGraphicsScene::focusItem()
{
void mapFromScenePath();
void sendEvent();
void wheelEvent();
+#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE)
void cursor();
void cursor2();
+#endif
void transformationAnchor();
void resizeAnchor();
void viewportUpdateMode();
void viewportUpdateMode2();
+#ifndef QT_NO_DRAGANDDROP
void acceptDrops();
+#endif
void optimizationFlags();
void optimizationFlags_dontSavePainterState();
void optimizationFlags_dontSavePainterState2_data();
void task239047_fitInViewSmallViewport();
void task245469_itemsAtPointWithClip();
void task253415_reconnectUpdateSceneOnSceneChanged();
+#ifndef Q_OS_WINCE
void task255529_transformationAnchorMouseAndViewportMargins();
+#endif
void task259503_scrollingArtifacts();
void QTBUG_4151_clipAndIgnore_data();
void QTBUG_4151_clipAndIgnore();
void QTBUG_5859_exposedRect();
+#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE)
void QTBUG_7438_cursor();
+#endif
void hoverLeave();
void QTBUG_16063_microFocusRect();
QVERIFY(widget->hasFocus());
}
+// Qt/CE does not have regular cursor support.
+#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE)
void tst_QGraphicsView::cursor()
{
-#ifndef QT_NO_CURSOR
-#if defined(Q_OS_WINCE)
- QSKIP("Qt/CE does not have regular cursor support", SkipAll);
-#endif
if (PlatformQuirks::haveMouseCursor())
QSKIP("The Platform does not have regular cursor support", SkipAll);
sendMouseMove(view.viewport(), QPoint(5, 5));
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
-#endif
}
+#endif
+// Qt/CE does not have regular cursor support.
+#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE)
void tst_QGraphicsView::cursor2()
{
-#ifndef QT_NO_CURSOR
-#if defined(Q_OS_WINCE)
- QSKIP("Qt/CE does not have regular cursor support", SkipAll);
-#endif
if (PlatformQuirks::haveMouseCursor())
QSKIP("The Platform does not have regular cursor support", SkipAll);
QCOMPARE(view.viewport()->cursor().shape(), Qt::IBeamCursor);
sendMouseMove(view.viewport(), view.mapFromScene(-15, -15));
QCOMPARE(view.viewport()->cursor().shape(), Qt::SizeAllCursor);
-#endif
}
+#endif
void tst_QGraphicsView::transformationAnchor()
{
#endif
}
+#ifndef QT_NO_DRAGANDDROP
void tst_QGraphicsView::acceptDrops()
{
-#ifdef QT_NO_DRAGANDDROP
- QSKIP("Drag'n drop disabled in this build", SkipAll);
-#else
QGraphicsView view;
// Excepted default behavior.
// Switching the view to not accept drops.
view.setAcceptDrops(false);
QVERIFY(!view.viewport()->acceptDrops());
-#endif
}
+#endif
void tst_QGraphicsView::optimizationFlags()
{
QVERIFY(wasConnected2);
}
+// Qt/CE does not implement mouse tracking at this point.
+#ifndef Q_OS_WINCE
void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Qt/CE does not implement mouse tracking at this point", SkipAll);
-#endif
-
QGraphicsScene scene(-100, -100, 200, 200);
scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue));
QVERIFY(qAbs(newMouseScenePos.x() - mouseScenePos.x()) < slack);
QVERIFY(qAbs(newMouseScenePos.y() - mouseScenePos.y()) < slack);
}
+#endif
void tst_QGraphicsView::task259503_scrollingArtifacts()
{
QCOMPARE(item.lastExposedRect, scene.lastBackgroundExposedRect);
}
+// Qt/CE does not have regular cursor support.
+#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE)
void tst_QGraphicsView::QTBUG_7438_cursor()
{
-#ifndef QT_NO_CURSOR
-#if defined(Q_OS_WINCE)
- QSKIP("Qt/CE does not have regular cursor support", SkipAll);
-#endif
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(-10, -10, 20, 20));
item->setFlag(QGraphicsItem::ItemIsMovable);
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
sendMouseRelease(view.viewport(), view.mapFromScene(0, 0));
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
-#endif
}
+#endif
class GraphicsItemWithHover : public QGraphicsRectItem
{
void textFormat();
void setTextFormat();
void buddy();
+#ifndef Q_WS_MAC
void setBuddy();
+#endif
void setFont();
void setNum();
void clear();
DEPENDS_ON( "setBuddy" );
}
+// Set buddy doesn't make much sense on Mac OS X.
+#ifndef Q_WS_MAC
void tst_QLabel::setBuddy()
{
-#ifdef Q_WS_MAC
- QSKIP("Set buddy doesn't make much sense on Mac OS X", SkipAll);
-#endif
testWidget->hide();
test_box = new Widget;
QVERIFY( test_edit->hasFocus() );
delete test_box;
}
+#endif
void tst_QLabel::text()
{
void noTextEditedOnClear();
+#ifndef QT_NO_CURSOR
void cursor();
+#endif
void textMargin_data();
void textMargin();
void taskQTBUG_7902_contextMenuCrash();
#endif
void taskQTBUG_7395_readOnlyShortcut();
+#ifdef Q_WS_X11
void QTBUG697_paletteCurrentColorGroup();
+#endif
void QTBUG13520_textNotVisible();
void bidiVisualMovement_data();
QTRY_COMPARE(testWidget.cursorPosition(), cursorPosition);
}
+#ifndef QT_NO_CURSOR
void tst_QLineEdit::cursor()
{
-#ifdef QT_NO_CURSOR
- QSKIP("Qt compiled without cursor support", SkipAll);
-#else
testWidget->setReadOnly(false);
QCOMPARE(testWidget->cursor().shape(), Qt::IBeamCursor);
testWidget->setReadOnly(true);
QCOMPARE(testWidget->cursor().shape(), Qt::ArrowCursor);
testWidget->setReadOnly(false);
QCOMPARE(testWidget->cursor().shape(), Qt::IBeamCursor);
-#endif
}
+#endif
class task180999_Widget : public QWidget
{
QCOMPARE(spy.count(), 1);
}
+#ifdef Q_WS_X11
void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup()
{
-#ifndef Q_WS_X11
- QSKIP("Only tested on X11", SkipAll);
-#endif
QLineEdit le;
le.setText(" ");
QPalette p = le.palette();
le.render(&img);
QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::red).rgb());
}
+#endif
void tst_QLineEdit::QTBUG13520_textNotVisible()
{
void saveRestore();
void saveRestore_data();
void isSeparator();
+#ifndef QT_NO_CURSOR
void setCursor();
+#endif
void addToolbarAfterShow();
void centralWidgetSize();
void dockWidgetSize();
void QTBUG2774_stylechange();
+#ifdef Q_OS_MAC
void toggleUnifiedTitleAndToolBarOnMac();
+#endif
};
// Testing get/set functions
using QMainWindow::event;
};
+#ifndef QT_NO_CURSOR
void tst_QMainWindow::setCursor()
{
-#ifdef QT_NO_CURSOR
- QSKIP("Qt compiled without cursor support(QT_NO_CURSOR)", SkipAll);
-#else
MainWindow mw;
QCursor cur = Qt::WaitCursor;
mw.setCursor(cur);
mw.event(&leaveE);
QTest::qWait(50);
QCOMPARE(cur.shape(), mw.cursor().shape());
-#endif
}
+#endif
void tst_QMainWindow::addToolbarAfterShow()
{
}
}
+#ifdef Q_OS_MAC
void tst_QMainWindow::toggleUnifiedTitleAndToolBarOnMac()
{
-#ifdef Q_OS_MAC
QMainWindow mw;
QToolBar *tb = new QToolBar;
tb->addAction("Test");
QVERIFY(frameGeometry.topLeft() == mw.frameGeometry().topLeft());
mw.setUnifiedTitleAndToolBarOnMac(true);
QVERIFY(frameGeometry.topLeft() == mw.frameGeometry().topLeft());
-#else
- QSKIP("Mac specific test", SkipAll);
-#endif
}
-
+#endif
QTEST_MAIN(tst_QMainWindow)
#include "tst_qmainwindow.moc"
void showShaded();
void showNormal_data();
void showNormal();
+#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE_WM)
void setOpaqueResizeAndMove_data();
void setOpaqueResizeAndMove();
+#endif
void setWindowFlags_data();
void setWindowFlags();
void mouseDoubleClick();
int _count;
};
+// This test requires cursor support, which is absent on WinCE
+#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE_WM)
void tst_QMdiSubWindow::setOpaqueResizeAndMove_data()
{
QTest::addColumn<bool>("opaqueMode");
void tst_QMdiSubWindow::setOpaqueResizeAndMove()
{
-#if defined (QT_NO_CURSOR) || defined (Q_OS_WINCE_WM) //For Windows CE we will set QT_NO_CURSOR if there is no cursor support
- QSKIP("No cursor available", SkipAll);
-#endif
QFETCH(bool, opaqueMode);
QFETCH(int, geometryCount);
QFETCH(int, expectedGeometryCount);
QCOMPARE(window->size(), windowSize + QSize(geometryCount, geometryCount));
}
}
+#endif
void tst_QMdiSubWindow::setWindowFlags_data()
{
void overrideMenuAction();
void statusTip();
void widgetActionFocus();
+#ifndef Q_OS_WINCE_WM
void mouseActivation();
+#endif
void tearOff();
void layoutDirection();
void task250673_activeMultiColumnSubMenuPosition();
void task256918_setFont();
void menuSizeHint();
+#ifndef Q_OS_WINCE_WM
void task258920_mouseBorder();
+#endif
void setFixedWidth();
void deleteActionInTriggered();
void pushButtonPopulateOnAboutToShow();
QCOMPARE(menus[0]->actions().count(), 0);
}
+// We have a separate mouseActivation test for Windows mobile.
+#ifndef Q_OS_WINCE_WM
void tst_QMenu::mouseActivation()
{
-#ifdef Q_OS_WINCE_WM
- QSKIP("We have a separate mouseActivation test for Windows mobile.", SkipAll);
-#endif
QWidget topLevel;
QMenu menu(&topLevel);
topLevel.show();
QVERIFY(submenu.isVisible());
#endif
}
-
+#endif
void
tst_QMenu::keyboardNavigation_data()
QVERIFY(sub->pos() != QPoint(0,0));
// well, it's enough to check the pos is not (0,0) but it's more safe
// to check that submenu is to the right of the main menu too.
-#ifdef Q_OS_WINCE_WM
- QSKIP("Not true for Windows Mobile Soft Keys", SkipSingle);
-#endif
-
+#ifndef Q_OS_WINCE_WM
QVERIFY(sub->pos().x() > main->pos().x());
QCOMPARE(sub->activeAction(), subAction);
+#endif
}
void tst_QMenu::task242454_sizeHint()
bool painted;
};
+
+// Mouse move related signals for Windows Mobile unavailable.
+#ifndef Q_OS_WINCE_WM
void tst_QMenu::task258920_mouseBorder()
{
-#ifdef Q_OS_WINCE_WM
- QSKIP("Mouse move related signals for Windows Mobile unavailable", SkipAll);
-#endif
#ifdef Q_WS_QPA
QSKIP("QTBUG-20753 QCursor::setPos() / QTest::mouseMove() doesn't work on qpa", SkipAll);
#endif
QCOMPARE(static_cast<QAction*>(0), menu.activeAction());
QVERIFY(menu.painted);
}
+#endif
void tst_QMenu::setFixedWidth()
{
void removeItem();
void count();
void insertItem_QString_QObject();
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void accel();
void activatedCount();
+#endif
void allowActiveAndDisabled();
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void check_accelKeys();
void check_cursorKeys1();
void check_cursorKeys2();
void check_cursorKeys3();
+#endif
void check_homeKey();
void check_endKey();
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void check_escKey();
+#endif
// void check_mouse1_data();
// void check_mouse1();
// void check_mouse2();
void check_altPress();
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void check_shortcutPress();
void check_menuPosition();
+#endif
void task223138_triggered();
void task256322_highlight();
void menubarSizeHint();
+#ifndef Q_WS_MAC
void taskQTBUG4965_escapeEaten();
+#endif
void taskQTBUG11823_crashwithInvisibleActions();
protected slots:
// printf( QString("acceleratorId: %1, count: %1\n").arg( i ).arg(activated_count) );
}
+// On Mac/WinCE, native key events are needed to test menu action activation.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::accel()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll);
-#endif
-
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar();
QCOMPARE( last_accel_id, action );
}
+#endif
+// On Mac/WinCE, native key events are needed to test menu action activation.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::activatedCount()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll);
-#endif
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar();
//wait(5000);
QCOMPARE( activated_count, 2 ); //1 from the popupmenu and 1 from the menubar
}
+#endif
void tst_QMenuBar::clear()
{
QVERIFY(actions.size() < 4); // there is no menu 4!
}
+// On Mac/WinCE, native key events are needed to test menu action activation.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_accelKeys()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll);
-#endif
initComplexMenubar();
// start with a bogus key that shouldn't trigger anything
QCOMPARE(item2_C->selCount(), 1u);
QCOMPARE(item2_D->selCount(), 1u);
}
+#endif
+// Qt/Mac,WinCE does not use the native popups/menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_cursorKeys1()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
// start with a ALT + 1 that activates the first popupmenu
QCOMPARE(item2_C->selCount(), 0u);
QCOMPARE(item2_D->selCount(), 0u);
}
+#endif
+// Qt/Mac,WinCE does not use the native popups/menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_cursorKeys2()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
// select popupmenu2
QCOMPARE(item2_C->selCount(), 0u);
QCOMPARE(item2_D->selCount(), 1u);
}
+#endif
/*!
If a popupmenu is active you can use Left to move to the menu to the left of it.
+ Qt/Mac,WinCE does not use the native popups/menubar.
*/
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_cursorKeys3()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
// select Popupmenu 2
QCOMPARE(item2_C->selCount(), 0u);
QCOMPARE(item2_D->selCount(), 0u);
}
+#endif
/*!
If a popupmenu is active you can use home to go quickly to the first item in the menu.
If Down is pressed next the popup is activated again.
*/
+// Qt/Mac,WinCE does not use the native popups/menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_escKey()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
QVERIFY( !pm1->isActiveWindow() );
// Let's see if the correct slot is called...
QVERIFY2( item2_C->selCount() == 1, "Expected item 2C to be selected" );
}
-
+#endif
// void tst_QMenuBar::check_mouse1_data()
// {
QVERIFY( ::qobject_cast<QMenuBar *>(qApp->focusWidget()) );
}
+// Qt/Mac,WinCE does not use the native popups/menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_shortcutPress()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
qApp->setActiveWindow(mw);
QTest::keyClick(mb, Qt::Key_2);
QVERIFY(pm1->isActiveWindow());
}
+#endif
+// Qt/Mac does not use the native popups/menubar.
+// Qt/CE uses native menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_menuPosition()
{
-#ifdef Q_WS_MAC
- QSKIP("Qt/Mac does not use the native popups/menubar", SkipAll);
-#endif
-#ifdef Q_OS_WINCE_WM
- QSKIP("Qt/CE uses native menubar", SkipAll);
-#endif
Menu menu;
initComplexMenubar();
menu.setTitle("&menu");
menu.close();
qApp->setLayoutDirection(dir);
}
-
}
+#endif
void tst_QMenuBar::task223138_triggered()
{
QCOMPARE(resSize, mb.sizeHint());
}
+// On Mac, do not test the menubar with escape key.
+#ifndef Q_WS_MAC
void tst_QMenuBar::taskQTBUG4965_escapeEaten()
{
-#ifdef Q_WS_MAC
- QSKIP("On Mac, do not test the menubar with escape key", SkipAll);
-#endif
QMenuBar menubar;
QMenu menu("menu1");
QAction *first = menubar.addMenu(&menu);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Escape); //now the action should be triggered
QTRY_VERIFY(!menubar.isVisible());
}
+#endif
void tst_QMenuBar::taskQTBUG11823_crashwithInvisibleActions()
{
void detailsText();
void detailsButtonText();
+#ifndef Q_WS_MAC
void shortcut();
+#endif
void staticSourceCompat();
void instanceSourceCompat();
}
}
+// Shortcuts are not used on Mac OS X.
+#ifndef Q_WS_MAC
void tst_QMessageBox::shortcut()
{
-#ifdef Q_WS_MAC
- QSKIP("shortcuts are not used on MAC OS X", SkipAll);
-#endif
QMessageBox msgBox;
msgBox.addButton("O&k", QMessageBox::YesRole);
msgBox.addButton("&No", QMessageBox::YesRole);
msgBox.addButton("&Maybe", QMessageBox::YesRole);
QCOMPARE(exec(&msgBox, Qt::Key_M), 2);
}
+#endif
void tst_QMessageBox::about()
{
QCOMPARE(exec(&mb, Qt::Key_Enter), int(QMessageBox::Yes));
QCOMPARE(exec(&mb, Qt::Key_Escape), int(QMessageBox::Cancel));
-#ifdef Q_WS_MAC
- QSKIP("mnemonics are not used on the MAC OS X", SkipAll);
-#endif
+#ifndef Q_WS_MAC
+ // mnemonics are not used on Mac OS X
QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_R), 0);
QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_Z), 1);
+#endif
}
void tst_QMessageBox::testSymbols()
void staticScrollers();
void scrollerProperties();
void scrollTo();
+#if !defined(QT_NO_GESTURES) && !(defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6))
void scroll();
void overshoot();
+#endif
};
/*! \internal
}
}
+// Mac OS X < 10.6 does not support QTouchEvents.
+#if !defined(QT_NO_GESTURES) && !(defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6))
void tst_QScroller::scroll()
{
-#if defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
- QSKIP("Mac OS X < 10.6 does not support QTouchEvents", SkipAll);
- return;
-#endif
-
-#ifndef QT_NO_GESTURES
// -- good case. normal scroll
tst_QScrollerWidget *sw = new tst_QScrollerWidget();
sw->scrollArea = QRectF(0, 0, 1000, 1000);
QCOMPARE(sw->currentPos.y(), 500.0);
delete sw;
-#endif
}
+#endif
+// Mac OS X < 10.6 does not support QTouchEvents.
+#if !defined(QT_NO_GESTURES) && !(defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6))
void tst_QScroller::overshoot()
{
-#if defined(Q_OS_MACX) && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
- QSKIP("Mac OS X < 10.6 does not support QTouchEvents", SkipAll);
- return;
-#endif
-
-#ifndef QT_NO_GESTURES
tst_QScrollerWidget *sw = new tst_QScrollerWidget();
sw->scrollArea = QRectF(0, 0, 1000, 1000);
QScroller::grabGesture(sw, QScroller::TouchGesture);
QVERIFY(qFuzzyCompare( sw->currentPos.y(), 500 ));
QCOMPARE( sw->receivedOvershoot, false );
-
delete sw;
-#endif
}
-
+#endif
QTEST_MAIN(tst_QScroller)
void cleanupTestCase();
void init();
void cleanup();
+#ifndef QT_NO_STYLE_MOTIF
void testMotifStyle();
+#endif
+#ifndef QT_NO_STYLE_PLASTIQUE
void testPlastiqueStyle();
+#endif
void testWindowsStyle();
+#ifndef QT_NO_STYLE_CDE
void testCDEStyle();
+#endif
+#if defined(Q_WS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP)
void testWindowsXPStyle();
+#endif
void testWindowsVistaStyle();
+#ifndef QT_NO_STYLE_CLEANLOOKS
void testCleanlooksStyle();
+#endif
void testMacStyle();
void testWindowsCEStyle();
void testWindowsMobileStyle();
}
}
+#ifndef QT_NO_STYLE_PLASTIQUE
void tst_QStyle::testPlastiqueStyle()
{
-#if !defined(QT_NO_STYLE_PLASTIQUE)
QPlastiqueStyle pstyle;
testAllFunctions(&pstyle);
lineUpLayoutTest(&pstyle);
-#else
- QSKIP("No Plastique style", SkipAll);
-#endif
}
+#endif
+#ifndef QT_NO_STYLE_CLEANLOOKS
void tst_QStyle::testCleanlooksStyle()
{
-#if !defined(QT_NO_STYLE_CLEANLOOKS)
QCleanlooksStyle cstyle;
testAllFunctions(&cstyle);
lineUpLayoutTest(&cstyle);
-#else
- QSKIP("No Cleanlooks style", SkipAll);
-#endif
}
+#endif
void tst_QStyle::testWindowsStyle()
{
wstyle.drawControl(QStyle::CE_ProgressBar, &pb, &painter, 0);
}
+#if defined(Q_WS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP)
void tst_QStyle::testWindowsXPStyle()
{
-#if defined(Q_WS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP)
QWindowsXPStyle xpstyle;
testAllFunctions(&xpstyle);
lineUpLayoutTest(&xpstyle);
-#else
- QSKIP("No WindowsXP style", SkipAll);
-#endif
}
+#endif
void writeImage(const QString &fileName, QImage image)
{
#endif
}
+#ifndef QT_NO_STYLE_MOTIF
void tst_QStyle::testMotifStyle()
{
-#if !defined(QT_NO_STYLE_MOTIF)
QMotifStyle mstyle;
testAllFunctions(&mstyle);
-#else
- QSKIP("No Motif style", SkipAll);
-#endif
}
+#endif
+#ifndef QT_NO_STYLE_CDE
void tst_QStyle::testCDEStyle()
{
-#if !defined(QT_NO_STYLE_CDE)
QCDEStyle cstyle;
testAllFunctions(&cstyle);
-#else
- QSKIP("No CDE style", SkipAll);
-#endif
}
+#endif
void tst_QStyle::testWindowsCEStyle()
{
void taskQTBUG_8777_scrollToSpans();
void taskQTBUG_10169_sizeHintForRow();
+#ifndef Q_OS_WINCE
void mouseWheel_data();
void mouseWheel();
+#endif
void addColumnWhileEditing();
void task234926_setHeaderSorting();
}
+// Since different Windows CE versions sport different taskbars, we skip this test.
+#ifndef Q_OS_WINCE
void tst_QTableView::mouseWheel_data()
{
QTest::addColumn<int>("scrollMode");
void tst_QTableView::mouseWheel()
{
-#ifdef Q_OS_WINCE
- QSKIP("Since different Windows CE versions sport different taskbars, we skip this test", SkipAll);
-#endif
QFETCH(int, scrollMode);
QFETCH(int, delta);
QApplication::sendEvent(view.viewport(), &verticalEvent);
QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 10);
}
+#endif
void tst_QTableView::addColumnWhileEditing()
{
void tst_windowFilePath_data();
void tst_windowFilePath();
+#ifdef Q_WS_X11
void tst_showWithoutActivating();
+#endif
void tst_paintEventOnSecondShow();
};
}
}
+#ifdef Q_WS_X11
void tst_QWidget_window::tst_showWithoutActivating()
{
-#ifndef Q_WS_X11
- QSKIP("This test is X11-only.", SkipAll);
-#else
QWidget w;
w.show();
QTest::qWaitForWindowShown(&w);
(XGetInputFocus(QX11Info::display(), &window, &revertto), window) );
// Note the use of the , before window because we want the XGetInputFocus to be re-executed
// in each iteration of the inside loop of the QTRY_COMPARE macro
-
-#endif // Q_WS_X11
}
+#endif
void tst_QWidget_window::tst_paintEventOnSecondShow()
{
void slotWithException() throw(MyStruct);
void dontStripNamespaces();
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void oldStyleCasts();
void warnOnExtraSignalSlotQualifiaction();
+#endif
+#ifndef NOLONGLONG
void uLongLong();
+#endif
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void inputFileNameWithDotsButNoExtension();
+#endif
void userProperties();
void supportConstSignals();
void task87883();
void slotsWithVoidTemplate();
void structQObject();
void namespacedFlags();
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void warnOnMultipleInheritance();
void forgottenQInterface();
+#endif
void os9Newline();
void winNewline();
void escapesInStringLiterals();
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_UNIX) && !defined(QT_NO_PROCESS)
void frameworkSearchPath();
+#endif
void cstyleEnums();
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void defineMacroViaCmdline();
+#endif
void invokable();
void singleFunctionKeywordSignalAndSlot();
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void templateGtGt();
+#endif
void qprivateslots();
void qprivateproperties();
void inlineSlotsWithThrowDeclaration();
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void warnOnPropertyWithoutREAD();
+#endif
void constructors();
void typenameWithUnsigned();
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void warnOnVirtualSignal();
+#endif
void QTBUG5590_dummyProperty();
void QTBUG12260_defaultTemplate();
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void notifyError();
+#endif
void QTBUG17635_invokableAndProperty();
void revisions();
+#ifndef MOC_CROSS_COMPILED
void warnings_data();
void warnings();
+#endif
void privateClass();
signals:
QCOMPARE(receiver.intCallCount, 1);
}
-
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::oldStyleCasts()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
proc.start("moc", QStringList(srcify("/oldstyle-casts.h")));
QVERIFY(proc.waitForFinished());
QVERIFY(proc.waitForFinished());
QCOMPARE(proc.exitCode(), 0);
QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardError()), QString());
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::warnOnExtraSignalSlotQualifiaction()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
proc.start("moc", QStringList(srcify("extraqualification.h")));
QVERIFY(proc.waitForFinished());
QCOMPARE(mocWarning, QString(SRCDIR) +
QString("/extraqualification.h:53: Warning: Function declaration Test::badFunctionDeclaration contains extra qualification. Ignoring as signal or slot.\n") +
QString(SRCDIR) + QString("/extraqualification.h:56: Warning: parsemaybe: Function declaration Test::anotherOne contains extra qualification. Ignoring as signal or slot.\n"));
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
+// long long doesn't work on MSVC6 & .NET 2002, also skipped on 2003 due to compiler version issue with moc
+#ifndef NOLONGLONG
void tst_Moc::uLongLong()
{
-#ifndef NOLONGLONG
TestClass tst;
const QMetaObject *mobj = tst.metaObject();
int idx = mobj->indexOfSlot("slotWithULong(ulong)");
QVERIFY(idx != -1);
idx = mobj->indexOfSlot("slotWithLongLong(long long)");
QVERIFY(idx != -1);
-#else
- QSKIP("long long doesn't work on MSVC6 & .NET 2002, also skipped on 2003 due to compiler version issue with moc", SkipAll);
-#endif
}
+#endif
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::inputFileNameWithDotsButNoExtension()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
proc.setWorkingDirectory(QString(SRCDIR) + "/task71021");
proc.start("moc", QStringList("../Header"));
QVERIFY(proc.waitForFinished());
QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardError()), QString());
QCOMPARE(proc.exitCode(), 0);
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
void tst_Moc::userProperties()
{
QCOMPARE(l, qvariant_cast<QList<Foo::Bar::Flags> >(baz.property("flagsList")));
}
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::warnOnMultipleInheritance()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
QStringList args;
args << "-I" << qtIncludePath + "/QtGui"
QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError());
QCOMPARE(mocWarning, QString(SRCDIR) +
QString("/warn-on-multiple-qobject-subclasses.h:53: Warning: Class Bar inherits from two QObject subclasses QWindow and Foo. This is not supported!\n"));
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::forgottenQInterface()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
QStringList args;
args << "-I" << qtIncludePath + "/QtCore"
QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError());
QCOMPARE(mocWarning, QString(SRCDIR) +
QString("/forgotten-qinterface.h:55: Warning: Class Test implements the interface MyInterface but does not list it in Q_INTERFACES. qobject_cast to MyInterface will not work!\n"));
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
void tst_Moc::os9Newline()
{
QByteArray("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nb"));
}
+// Only tested on unix. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_UNIX) && !defined(QT_NO_PROCESS)
void tst_Moc::frameworkSearchPath()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_UNIX) && !defined(QT_NO_PROCESS)
QStringList args;
args << "-F" << srcify(".")
<< srcify("interface-from-framework.h")
}
QCOMPARE(proc.exitCode(), 0);
QCOMPARE(proc.readAllStandardError(), QByteArray());
-#else
- QSKIP("Only tested/relevant on unixy platforms", SkipAll);
-#endif
}
+#endif
void tst_Moc::cstyleEnums()
{
QCOMPARE(metaEnum.key(1), "Bar");
}
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::templateGtGt()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
proc.start("moc", QStringList(srcify("template-gtgt.h")));
QVERIFY(proc.waitForFinished());
QVERIFY(!mocOut.isEmpty());
QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError());
QVERIFY(mocWarning.isEmpty());
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
+// Only tested on linux/gcc.
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::defineMacroViaCmdline()
{
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
QStringList args;
QCOMPARE(proc.readAllStandardError(), QByteArray());
QByteArray mocOut = proc.readAllStandardOutput();
QVERIFY(!mocOut.isEmpty());
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
void tst_Moc::invokable()
{
QVERIFY(mobj->indexOfSlot("e()") != -1);
}
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::warnOnPropertyWithoutREAD()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
proc.start("moc", QStringList(srcify("warn-on-property-without-read.h")));
QVERIFY(proc.waitForFinished());
QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError());
QCOMPARE(mocWarning, QString(SRCDIR) +
QString("/warn-on-property-without-read.h:46: Warning: Property declaration foo has no READ accessor function. The property will be invalid.\n"));
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
void tst_Moc::constructors()
{
QVERIFY(mobj->indexOfSlot("l(unsignedQImage)") != -1);
}
-
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::warnOnVirtualSignal()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
proc.start("moc", QStringList(srcify("pure-virtual-signals.h")));
QVERIFY(proc.waitForFinished());
QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError());
QCOMPARE(mocWarning, QString(SRCDIR) + QString("/pure-virtual-signals.h:48: Warning: Signals cannot be declared virtual\n") +
QString(SRCDIR) + QString("/pure-virtual-signals.h:50: Warning: Signals cannot be declared virtual\n"));
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
-
+#endif
class QTBUG5590_DummyObject: public QObject
{
QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1);
}
+// Only tested on linux/gcc. Not tested when cross-compiled.
+#if !defined(MOC_CROSS_COMPILED) && defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
void tst_Moc::notifyError()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
QProcess proc;
proc.start("moc", QStringList(srcify("error-on-wrong-notify.h")));
QVERIFY(proc.waitForFinished());
QString mocError = QString::fromLocal8Bit(proc.readAllStandardError());
QCOMPARE(mocError, QString(SRCDIR) +
QString("/error-on-wrong-notify.h:52: Error: NOTIFY signal 'fooChanged' of property 'foo' does not exist in class ClassWithWrongNOTIFY.\n"));
-#else
- QSKIP("Only tested on linux/gcc", SkipAll);
-#endif
}
+#endif
class QTBUG_17635_InvokableAndProperty : public QObject
{
revisions_T<VersionTestNotify>();
}
+// Not tested when cross-compiled.
+#ifndef MOC_CROSS_COMPILED
void tst_Moc::warnings_data()
{
QTest::addColumn<QByteArray>("input");
void tst_Moc::warnings()
{
-#ifdef MOC_CROSS_COMPILED
- QSKIP("Not tested when cross-compiled", SkipAll);
-#endif
-
QFETCH(QByteArray, input);
QFETCH(QStringList, args);
QFETCH(int, exitCode);
if (expectedStdOut != "IGNORE_ALL_STDOUT")
QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardOutput()).trimmed(), expectedStdOut);
QCOMPARE(QString::fromLocal8Bit(proc.readAllStandardError()).trimmed(), expectedStdErr);
-
- }
+}
+#endif
class tst_Moc::PrivateClass : public QObject {
Q_PROPERTY(int someProperty READ someSlot WRITE someSlot2)
private slots:
void getSetCheck();
void interpretedAs0D() const;
+#ifndef QT_NO_EXCEPTIONS
void exception();
+#endif
};
class MyXmlEntityResolver : public QXmlEntityResolver
QCOMPARE(myHandler.attrName, QChar(0x010D) + QString::fromLatin1("reated-by"));
}
+#ifndef QT_NO_EXCEPTIONS
void tst_QXml::exception()
{
-#ifndef QT_NO_EXCEPTIONS
QString message = QString::fromLatin1("message");
int column = 3;
int line = 2;
QCOMPARE(e.publicId(), publicId);
QCOMPARE(e.systemId(), systemId);
}
-#else
- QSKIP("Exceptions not available", SkipAll);
-#endif
}
+#endif
QTEST_MAIN(tst_QXml)
#include "tst_qxml.moc"