summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-19 16:35:06 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-19 16:35:06 (GMT)
commit901b0391d15ab72830fcfd73048eeff03fb9ed07 (patch)
treecf5f2f2eab83301bf08952426f25eb54a90e9ac4 /tests
parentbb4e301ce6762ab300618c579bd65ea1ee17dc2d (diff)
parent34044853d4315309920a481a585f96ba7b3fb140 (diff)
downloadQt-901b0391d15ab72830fcfd73048eeff03fb9ed07.zip
Qt-901b0391d15ab72830fcfd73048eeff03fb9ed07.tar.gz
Qt-901b0391d15ab72830fcfd73048eeff03fb9ed07.tar.bz2
Merge remote branch 'mainline/4.6' into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro59
-rw-r--r--tests/auto/qalgorithms/tst_qalgorithms.cpp4
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp15
-rw-r--r--tests/auto/qfile/tst_qfile.cpp17
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp14
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp16
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp24
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp42
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp26
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp1
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp8
-rw-r--r--tests/auto/qsysinfo/.gitignore1
-rw-r--r--tests/auto/qsysinfo/qsysinfo.pro5
-rw-r--r--tests/auto/qsysinfo/tst_qsysinfo.cpp52
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp27
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp17
-rw-r--r--tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp27
-rw-r--r--tests/auto/rcc/rcc.pro6
-rw-r--r--tests/auto/rcc/tst_rcc.cpp2
-rw-r--r--tests/auto/windowsmobile/test/test.pro2
-rw-r--r--tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro3
-rw-r--r--tests/manual/keypadnavigation/keypadnavigation.ui157
-rw-r--r--tests/manual/keypadnavigation/main.cpp8
23 files changed, 355 insertions, 178 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index da1f7ca..d5d72a7 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -59,9 +59,15 @@ Q3SUBDIRS += \
q3toolbar \
q3urloperator \
q3valuelist \
- q3valuevector
+ q3valuevector \
+ q3combobox \
+ q3frame \
+ q3uridrag \
+ q3widgetstack
SUBDIRS += \
+# exceptionsafety_objects \ shouldn't enable it
+ languagechange \
collections \
exceptionsafety \
mediaobject \
@@ -403,8 +409,55 @@ SUBDIRS += \
symbols \
qrand \
utf8 \
- gestures
-
+ gestures \
+ qabstractnetworkcache \
+ qabstractproxymodel \
+ qbytearraymatcher \
+ qcalendarwidget \
+ qcolumnview \
+ qcommandlinkbutton \
+ qdbuscontext \
+ qdbusserver \
+ qdbusservicewatcher \
+ qdiriterator \
+ qeasingcurve \
+ qfileiconprovider \
+ qformlayout \
+ q_func_info \
+ qfuture \
+ qfuturewatcher \
+ qguard \
+ qhttpsocketengine \
+ qinputcontext \
+ qlocalsocket \
+ qmacstyle \
+ qmargins \
+ qnetworkaddressentry \
+ qnetworkcachemetadata \
+ qnetworkdiskcache \
+ qobjectperformance \
+ qpainterpathstroker \
+ qplugin \
+ qpluginloader \
+ qscrollbar \
+ qsharedmemory \
+ qsidebar \
+ qsizegrip \
+ qsoftkeymanager \
+ qsqldriver \
+ qsystemsemaphore \
+ qtconcurrentfilter \
+ qtconcurrentiteratekernel \
+ qtconcurrentmap \
+ qtconcurrentrun \
+ qtconcurrentthreadengine \
+ qthreadpool \
+ qtokenautomaton \
+ qtouchevent \
+ qwidget_window \
+ rcc \
+ windowsmobile
+
!wince*:SUBDIRS += $$Q3SUBDIRS
contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter
diff --git a/tests/auto/qalgorithms/tst_qalgorithms.cpp b/tests/auto/qalgorithms/tst_qalgorithms.cpp
index 176a451..1e24efe 100644
--- a/tests/auto/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/qalgorithms/tst_qalgorithms.cpp
@@ -620,8 +620,8 @@ void tst_QAlgorithms::test_qBinaryFind()
//-42 means not found
if (resultValue == -42) {
- QVERIFY(qBinaryFind(data.constBegin(), data.constEnd(), resultValue) == data.end());
- QVERIFY(qBinaryFind(data, resultValue) == data.end());
+ QVERIFY(qBinaryFind(data.constBegin(), data.constEnd(), resultValue) == data.constEnd());
+ QVERIFY(qBinaryFind(data, resultValue) == data.constEnd());
QVERIFY(qBinaryFind(data.begin(), data.end(), resultValue) == data.end());
QVERIFY(qBinaryFind(data.begin(), data.end(), resultValue, qLess<int>()) == data.end());
return;
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index e903ab5..af71961 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -2290,11 +2290,8 @@ void tst_QComboBox::setItemDelegate()
QComboBox comboBox;
QStyledItemDelegate *itemDelegate = new QStyledItemDelegate;
comboBox.setItemDelegate(itemDelegate);
-#ifdef Q_CC_MWERKS
+ // the cast is a workaround for the XLC and Metrowerks compilers
QCOMPARE(static_cast<QStyledItemDelegate *>(comboBox.itemDelegate()), itemDelegate);
-#else
- QCOMPARE(comboBox.itemDelegate(), itemDelegate);
-#endif
}
void tst_QComboBox::task253944_itemDelegateIsReset()
@@ -2303,19 +2300,13 @@ void tst_QComboBox::task253944_itemDelegateIsReset()
QStyledItemDelegate *itemDelegate = new QStyledItemDelegate;
comboBox.setItemDelegate(itemDelegate);
+ // the casts are workarounds for the XLC and Metrowerks compilers
+
comboBox.setEditable(true);
-#ifdef Q_CC_MWERKS
QCOMPARE(static_cast<QStyledItemDelegate *>(comboBox.itemDelegate()), itemDelegate);
-#else
- QCOMPARE(comboBox.itemDelegate(), itemDelegate);
-#endif
comboBox.setStyleSheet("QComboBox { border: 1px solid gray; }");
-#ifdef Q_CC_MWERKS
QCOMPARE(static_cast<QStyledItemDelegate *>(comboBox.itemDelegate()), itemDelegate);
-#else
- QCOMPARE(comboBox.itemDelegate(), itemDelegate);
-#endif
}
diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp
index b3d6fd9..cf46ce1 100644
--- a/tests/auto/qfile/tst_qfile.cpp
+++ b/tests/auto/qfile/tst_qfile.cpp
@@ -210,6 +210,7 @@ private slots:
void task167217();
void openDirectory();
+ void writeNothing();
public:
// disabled this test for the moment... it hangs
@@ -750,6 +751,7 @@ void tst_QFile::readAllStdin()
QProcess process;
process.start("stdinprocess/stdinprocess all");
+ QVERIFY( process.waitForStarted() );
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
process.write(lotsOfData);
@@ -2489,13 +2491,13 @@ void tst_QFile::readEof()
}
QByteArray ret = file.read(10);
- QVERIFY(ret.isNull());
+ QVERIFY(ret.isEmpty());
QVERIFY(file.error() == QFile::NoError);
QVERIFY(file.atEnd());
// Do it again to ensure that we get the same result
ret = file.read(10);
- QVERIFY(ret.isNull());
+ QVERIFY(ret.isEmpty());
QVERIFY(file.error() == QFile::NoError);
QVERIFY(file.atEnd());
}
@@ -2840,5 +2842,16 @@ void tst_QFile::openStandardStreams()
}
}
+void tst_QFile::writeNothing()
+{
+ for (int i = 0; i < 3; ++i) {
+ QFile file("file.txt");
+ QVERIFY( openFile(file, QIODevice::WriteOnly | QIODevice::Unbuffered, FileType(i)) );
+ QVERIFY( 0 == file.write((char *)0, 0) );
+ QCOMPARE( file.error(), QFile::NoError );
+ closeFile(file);
+ }
+}
+
QTEST_MAIN(tst_QFile)
#include "tst_qfile.moc"
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index e80f8e0..efb1b56 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -72,6 +72,7 @@ private slots:
void veryNarrowElidedText();
void averageCharWidth();
void elidedMultiLength();
+ void elidedMultiLengthF();
void bearingIncludedInBoundingRect();
};
@@ -218,13 +219,13 @@ void tst_QFontMetrics::averageCharWidth()
QVERIFY(fmf.averageCharWidth() != 0);
}
-void tst_QFontMetrics::elidedMultiLength()
+template<class FontMetrics> void elidedMultiLength_helper()
{
QString text1 = "Long Text 1\x9cShorter\x9csmall";
QString text1_long = "Long Text 1";
QString text1_short = "Shorter";
QString text1_small = "small";
- QFontMetrics fm = QFontMetrics(QFont());
+ FontMetrics fm = FontMetrics(QFont());
int width_long = fm.size(0, text1_long).width();
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, 8000), text1_long);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long + 1), text1_long);
@@ -238,7 +239,16 @@ void tst_QFontMetrics::elidedMultiLength()
QString text1_el = QString::fromLatin1("s") + ellipsisChar;
int width_small = fm.width(text1_el);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_small + 1), text1_el);
+}
+void tst_QFontMetrics::elidedMultiLength()
+{
+ elidedMultiLength_helper<QFontMetrics>();
+}
+
+void tst_QFontMetrics::elidedMultiLengthF()
+{
+ elidedMultiLength_helper<QFontMetricsF>();
}
void tst_QFontMetrics::bearingIncludedInBoundingRect()
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index a49c2c1..20d9eb8 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -276,6 +276,7 @@ private slots:
void task176178_itemIndexMethodBreaksSceneRect();
void task160653_selectionChanged();
void task250680_childClip();
+ void taskQTBUG_5904_crashWithDeviceCoordinateCache();
};
void tst_QGraphicsScene::initTestCase()
@@ -4180,5 +4181,20 @@ void tst_QGraphicsScene::isActive()
}
+void tst_QGraphicsScene::taskQTBUG_5904_crashWithDeviceCoordinateCache()
+{
+ QGraphicsScene scene;
+ QGraphicsRectItem *rectItem = scene.addRect(QRectF(0, 0, 100, 200), QPen(Qt::black), QBrush(Qt::green));
+
+ rectItem->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
+
+ QPixmap pixmap(100,200);
+ QPainter painter(&pixmap);
+ painter.setRenderHint(QPainter::Antialiasing);
+ scene.render(&painter);
+ painter.end();
+ // No crash, then it passed!
+}
+
QTEST_MAIN(tst_QGraphicsScene)
#include "tst_qgraphicsscene.moc"
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index 829e55c..3b98c2f 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -161,6 +161,7 @@ private slots:
void respectHFW();
void addChildInpolishEvent();
void polishEvent();
+ void polishEvent2();
// Task fixes
void task236127_bspTreeIndexFails();
@@ -2796,6 +2797,29 @@ void tst_QGraphicsWidget::polishEvent()
QCOMPARE(widget->events.at(0), QEvent::Polish);
}
+void tst_QGraphicsWidget::polishEvent2()
+{
+ class MyGraphicsWidget : public QGraphicsWidget
+ { public:
+ void polishEvent()
+ { events << QEvent::Polish; }
+ QList<QEvent::Type> events;
+ };
+
+ QGraphicsScene scene;
+
+ MyGraphicsWidget *widget = new MyGraphicsWidget;
+ widget->hide();
+ scene.addItem(widget);
+
+ widget->events.clear();
+
+ QApplication::processEvents();
+
+ // Make sure the item got polish event.
+ QVERIFY(widget->events.contains(QEvent::Polish));
+}
+
QTEST_MAIN(tst_QGraphicsWidget)
#include "tst_qgraphicswidget.moc"
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index 1c8fecf..596ac9b 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -122,6 +122,7 @@ private slots:
void taskQTBUG_633_changeModelData();
void taskQTBUG_435_deselectOnViewportClick();
void taskQTBUG_2678_spacingAndWrappedText();
+ void taskQTBUG_5877_skippingItemInPageDownUp();
};
// Testing get/set functions
@@ -509,9 +510,7 @@ void tst_QListView::moveCursor2()
QModelIndex idx = vu.moveCursor(QMoveCursorListView::MoveHome, Qt::NoModifier);
QCOMPARE(idx, model.index(0,0));
idx = vu.moveCursor(QMoveCursorListView::MoveDown, Qt::NoModifier);
- QModelIndex p = model.index(8,0);
QCOMPARE(idx, model.index(8,0));
-
}
void tst_QListView::moveCursor3()
@@ -605,7 +604,6 @@ void tst_QListView::indexAt()
QVERIFY(view2.m_index.isValid());
QVERIFY(view2.m_index.row() != 0);
-
}
void tst_QListView::clicked()
@@ -703,7 +701,6 @@ void tst_QListView::modelColumn()
view.setModel(&model);
-
//
// Set and get with a valid model
//
@@ -743,7 +740,6 @@ void tst_QListView::modelColumn()
}
}
-
void tst_QListView::hideFirstRow()
{
QStringList items;
@@ -814,7 +810,6 @@ void tst_QListView::batchedMode()
ba.setBit(idx.row(), true);
}
QCOMPARE(ba.size(), 3);
-
}
void tst_QListView::setCurrentIndex()
@@ -1146,7 +1141,6 @@ void tst_QListView::selection()
for (int i = 0; i < selected.count(); ++i) {
QVERIFY(expectedItems.contains(selected.at(i).row()));
}
-
}
void tst_QListView::scrollTo()
@@ -1251,7 +1245,6 @@ void tst_QListView::scrollTo()
QTest::keyClick(lv.viewport(), Qt::Key_Up, Qt::NoModifier);
QCOMPARE(lv.visualRect(index).y(), 0);
-
}
@@ -1772,7 +1765,6 @@ void tst_QListView::clickOnViewportClearsSelection()
QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, point);
//now the selection should be cleared
QVERIFY(!view.selectionModel()->hasSelection());
-
}
void tst_QListView::task262152_setModelColumnNavigate()
@@ -1795,7 +1787,6 @@ void tst_QListView::task262152_setModelColumnNavigate()
QTest::keyClick(&view, Qt::Key_Down);
QTest::qWait(30);
QTRY_COMPARE(view.currentIndex(), model.index(2,1));
-
}
void tst_QListView::taskQTBUG_2233_scrollHiddenItems_data()
@@ -1891,5 +1882,36 @@ void tst_QListView::taskQTBUG_2678_spacingAndWrappedText()
QCOMPARE(w.horizontalScrollBar()->minimum(), w.horizontalScrollBar()->maximum());
}
+void tst_QListView::taskQTBUG_5877_skippingItemInPageDownUp()
+{
+ QList<int> currentItemIndexes;
+ QtTestModel model(0);
+ model.colCount = 1;
+ model.rCount = 100;
+
+ currentItemIndexes << 0 << 6 << 16 << 25 << 34 << 42 << 57 << 68 << 77
+ << 83 << 91 << 94;
+ QMoveCursorListView vu;
+ vu.setModel(&model);
+ vu.show();
+
+ int itemHeight = vu.visualRect(model.index(0, 0)).height();
+ int visibleRowCount = vu.height() / itemHeight;
+ int scrolledRowCount = visibleRowCount - 1;
+
+ for (int i = 0; i < currentItemIndexes.size(); ++i) {
+ vu.selectionModel()->setCurrentIndex(model.index(currentItemIndexes[i], 0),
+ QItemSelectionModel::SelectCurrent);
+
+ QModelIndex idx = vu.moveCursor(QMoveCursorListView::MovePageDown, Qt::NoModifier);
+ int newCurrent = qMin(currentItemIndexes[i] + scrolledRowCount, 99);
+ QCOMPARE(idx, model.index(newCurrent, 0));
+
+ idx = vu.moveCursor(QMoveCursorListView::MovePageUp, Qt::NoModifier);
+ newCurrent = qMax(currentItemIndexes[i] - scrolledRowCount, 0);
+ QCOMPARE(idx, model.index(newCurrent, 0));
+ }
+}
+
QTEST_MAIN(tst_QListView)
#include "tst_qlistview.moc"
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index f0f69a4..7cdfe46 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -87,6 +87,7 @@ private slots:
void widgetActionFocus();
void mouseActivation();
void tearOff();
+ void layoutDirection();
#if defined(QT3_SUPPORT)
void indexBasedInsertion_data();
@@ -596,6 +597,31 @@ void tst_QMenu::tearOff()
QVERIFY(!torn->isVisible());
}
+void tst_QMenu::layoutDirection()
+{
+ QMainWindow win;
+ win.setLayoutDirection(Qt::RightToLeft);
+
+ QMenu menu(&win);
+ menu.show();
+ QTest::qWaitForWindowShown(&menu);
+ QCOMPARE(menu.layoutDirection(), Qt::RightToLeft);
+ menu.close();
+
+ menu.setParent(0);
+ menu.show();
+ QTest::qWaitForWindowShown(&menu);
+ QCOMPARE(menu.layoutDirection(), QApplication::layoutDirection());
+ menu.close();
+
+ //now the menubar
+ QAction *action = win.menuBar()->addMenu(&menu);
+ win.menuBar()->setActiveAction(action);
+ QTest::qWaitForWindowShown(&menu);
+ QCOMPARE(menu.layoutDirection(), Qt::RightToLeft);
+}
+
+
#if defined(QT3_SUPPORT)
void tst_QMenu::indexBasedInsertion_data()
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index db46b66..169a688 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -347,7 +347,6 @@ void tst_QSslSocket::constructing()
QCOMPARE(socket.sslConfiguration(), QSslConfiguration::defaultConfiguration());
QCOMPARE(socket.errorString(), QString("Unknown error"));
char c = '\0';
- QTest::ignoreMessage(QtWarningMsg, "QIODevice::getChar: Closed device");
QVERIFY(!socket.getChar(&c));
QCOMPARE(c, '\0');
QVERIFY(!socket.isOpen());
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index fd39515..a13bb0d 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -209,6 +209,7 @@ private slots:
void task260403_clonedSignals();
void postEventFromOtherThread();
void eventFilterForApplication();
+ void eventClassesExported();
};
tst_QStateMachine::tst_QStateMachine()
@@ -4307,5 +4308,12 @@ void tst_QStateMachine::eventFilterForApplication()
QVERIFY(machine.configuration().contains(s2));
}
+void tst_QStateMachine::eventClassesExported()
+{
+ // make sure this links
+ QStateMachine::WrappedEvent *wrappedEvent = new QStateMachine::WrappedEvent(0, 0);
+ QStateMachine::SignalEvent *signalEvent = new QStateMachine::SignalEvent(0, 0, QList<QVariant>());
+}
+
QTEST_MAIN(tst_QStateMachine)
#include "tst_qstatemachine.moc"
diff --git a/tests/auto/qsysinfo/.gitignore b/tests/auto/qsysinfo/.gitignore
deleted file mode 100644
index e50cae2..0000000
--- a/tests/auto/qsysinfo/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tst_qsysinfo
diff --git a/tests/auto/qsysinfo/qsysinfo.pro b/tests/auto/qsysinfo/qsysinfo.pro
deleted file mode 100644
index e822fec..0000000
--- a/tests/auto/qsysinfo/qsysinfo.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-load(qttest_p4)
-SOURCES += tst_qsysinfo.cpp
-QT = core
-
-
diff --git a/tests/auto/qsysinfo/tst_qsysinfo.cpp b/tests/auto/qsysinfo/tst_qsysinfo.cpp
deleted file mode 100644
index 8784863..0000000
--- a/tests/auto/qsysinfo/tst_qsysinfo.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include <QtTest/QtTest>
-
-class tst_QSysInfo: public QObject
-{
- Q_OBJECT
-private slots:
-};
-
-QTEST_MAIN(tst_QSysInfo)
-#include "tst_qsysinfo.moc"
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index f571e8a..46c3fb6 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -198,6 +198,7 @@ private slots:
void task191545_dragSelectRows();
void taskQTBUG_5062_spansInconsistency();
void taskQTBUG_4516_clickOnRichTextLabel();
+ void taskQTBUG_5237_wheelEventOnHeader();
void mouseWheel_data();
void mouseWheel();
@@ -3613,17 +3614,9 @@ void tst_QTableView::mouseWheel_data()
QTest::newRow("scroll down per item")
<< int(QAbstractItemView::ScrollPerItem) << -120
<< 10 + qApp->wheelScrollLines() << 10 + qApp->wheelScrollLines();
-#ifdef Q_WS_MAC
- // On Mac, we always scroll one pixel per 120 delta (rather than multiplying with
- // singleStep) since wheel events are accelerated by the OS.
- QTest::newRow("scroll down per pixel")
- << int(QAbstractItemView::ScrollPerPixel) << -120
- << 10 + qApp->wheelScrollLines() << 10 + qApp->wheelScrollLines();
-#else
QTest::newRow("scroll down per pixel")
<< int(QAbstractItemView::ScrollPerPixel) << -120
<< 10 + qApp->wheelScrollLines() * 89 << 10 + qApp->wheelScrollLines() * 28;
-#endif
}
void tst_QTableView::mouseWheel()
@@ -3913,7 +3906,7 @@ void tst_QTableView::changeHeaderData()
QTest::qWaitForWindowShown(&view);
QString text = "long long long text";
- const int textWidth = view.fontMetrics().width(text);
+ const int textWidth = view.verticalHeader()->fontMetrics().width(text);
QVERIFY(view.verticalHeader()->width() < textWidth);
model.setHeaderData(2, Qt::Vertical, text);
@@ -3922,6 +3915,22 @@ void tst_QTableView::changeHeaderData()
QVERIFY(view.verticalHeader()->width() > textWidth);
}
+void tst_QTableView::taskQTBUG_5237_wheelEventOnHeader()
+{
+ QTableView view;
+ QStandardItemModel model(500,5);
+ view.setModel(&model);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ int sbValueBefore = view.verticalScrollBar()->value();
+ QHeaderView *header = view.verticalHeader();
+ QTest::mouseMove(header);
+ QWheelEvent wheelEvent(header->geometry().center(), -720, 0, 0);
+ QApplication::sendEvent(header->viewport(), &wheelEvent);
+ int sbValueAfter = view.verticalScrollBar()->value();
+ QVERIFY(sbValueBefore != sbValueAfter);
+}
QTEST_MAIN(tst_QTableView)
#include "tst_qtableview.moc"
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index 4ed9fca..863b8f5 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -371,7 +371,6 @@ void tst_QTcpSocket::constructing()
QCOMPARE(socket->socketType(), QTcpSocket::TcpSocket);
char c;
- QTest::ignoreMessage(QtWarningMsg, "QIODevice::getChar: Closed device");
QCOMPARE(socket->getChar(&c), false);
QCOMPARE((int) socket->bytesAvailable(), 0);
QCOMPARE(socket->canReadLine(), false);
@@ -777,7 +776,7 @@ void tst_QTcpSocket::unget()
for (int i = 0; i < 10; i += 2) {
while (socket->bytesAvailable() < 2)
- QVERIFY(socket->waitForReadyRead(5000));
+ QVERIFY(socket->waitForReadyRead(10000));
int bA = socket->bytesAvailable();
QVERIFY(socket->read(buf, 2) == 2);
buf[2] = '\0';
@@ -830,7 +829,6 @@ void tst_QTcpSocket::openCloseOpenClose()
QVERIFY(socket->socketType() == QTcpSocket::TcpSocket);
char c;
- QTest::ignoreMessage(QtWarningMsg, "QIODevice::getChar: Closed device");
QCOMPARE(socket->getChar(&c), false);
QCOMPARE((int) socket->bytesAvailable(), 0);
QCOMPARE(socket->canReadLine(), false);
@@ -1959,7 +1957,6 @@ void tst_QTcpSocket::zeroAndMinusOneReturns()
QCOMPARE(socket->write("BLUBBER"), qint64(-1));
QCOMPARE(socket->read(c, 16), qint64(-1));
QCOMPARE(socket->readLine(c, 16), qint64(-1));
- QTest::ignoreMessage(QtWarningMsg, "QIODevice::getChar: Closed device");
QVERIFY(!socket->getChar(c));
QVERIFY(!socket->putChar('a'));
@@ -2118,7 +2115,7 @@ void tst_QTcpSocket::moveToThread0()
QTcpSocket *socket = newSocket();;
socket->connectToHost(QtNetworkSettings::serverName(), 143);
socket->moveToThread(0);
- QVERIFY(socket->waitForConnected(2000));
+ QVERIFY(socket->waitForConnected(5000));
socket->write("XXX LOGOUT\r\n");
QVERIFY(socket->waitForBytesWritten(5000));
QVERIFY(socket->waitForDisconnected());
@@ -2129,7 +2126,7 @@ void tst_QTcpSocket::moveToThread0()
QTcpSocket *socket = newSocket();
socket->moveToThread(0);
socket->connectToHost(QtNetworkSettings::serverName(), 143);
- QVERIFY(socket->waitForConnected(2000));
+ QVERIFY(socket->waitForConnected(5000));
socket->write("XXX LOGOUT\r\n");
QVERIFY(socket->waitForBytesWritten(5000));
QVERIFY(socket->waitForDisconnected());
@@ -2139,7 +2136,7 @@ void tst_QTcpSocket::moveToThread0()
// Case 3: Moved after writing, while waiting for bytes to be written.
QTcpSocket *socket = newSocket();
socket->connectToHost(QtNetworkSettings::serverName(), 143);
- QVERIFY(socket->waitForConnected(2000));
+ QVERIFY(socket->waitForConnected(5000));
socket->write("XXX LOGOUT\r\n");
socket->moveToThread(0);
QVERIFY(socket->waitForBytesWritten(5000));
@@ -2150,7 +2147,7 @@ void tst_QTcpSocket::moveToThread0()
// Case 4: Moved after writing, while waiting for response.
QTcpSocket *socket = newSocket();
socket->connectToHost(QtNetworkSettings::serverName(), 143);
- QVERIFY(socket->waitForConnected(2000));
+ QVERIFY(socket->waitForConnected(5000));
socket->write("XXX LOGOUT\r\n");
QVERIFY(socket->waitForBytesWritten(5000));
socket->moveToThread(0);
@@ -2306,7 +2303,7 @@ void tst_QTcpSocket::invalidProxy()
QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
} else {
QCOMPARE(socket->state(), QAbstractSocket::ConnectingState);
- QVERIFY(!socket->waitForConnected(2000));
+ QVERIFY(!socket->waitForConnected(5000));
}
QVERIFY(!socket->errorString().isEmpty());
@@ -2425,7 +2422,7 @@ void tst_QTcpSocket::proxyFactory()
QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
} else {
QCOMPARE(socket->state(), QAbstractSocket::ConnectingState);
- QVERIFY(socket->waitForConnected(2000));
+ QVERIFY(socket->waitForConnected(5000));
QCOMPARE(proxyAuthCalled, 1);
}
QVERIFY(!socket->errorString().isEmpty());
diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
index 78e0ce6..2f9cc04 100644
--- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -858,6 +858,33 @@ void tst_QTextScriptEngine::malayalam()
QSKIP("couln't find AkrutiMal2", SkipAll);
}
}
+ {
+ if (QFontDatabase().families(QFontDatabase::Malayalam).contains("Rachana")) {
+ QFont f("Rachana");
+ const ShapeTable shape_table [] = {
+ { { 0xd37, 0xd4d, 0xd1f, 0xd4d, 0xd30, 0xd40, 0x0 },
+ { 0x385, 0xa3, 0x0 } },
+ { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 },
+ { 0x2ff, 0x0 } },
+ { { 0xd33, 0xd4d, 0xd33, 0x0 },
+ { 0x3f8, 0x0 } },
+ { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 },
+ { 0x2ff, 0x0 } },
+
+ { {0}, {0} }
+ };
+
+
+ const ShapeTable *s = shape_table;
+ while (s->unicode[0]) {
+ QVERIFY( shaping(f, s) );
+ ++s;
+ }
+ } else {
+ QSKIP("couln't find Rachana", SkipAll);
+ }
+ }
+
#else
QSKIP("X11 specific test", SkipAll);
#endif
diff --git a/tests/auto/rcc/rcc.pro b/tests/auto/rcc/rcc.pro
index d6a2083..1759b48 100644
--- a/tests/auto/rcc/rcc.pro
+++ b/tests/auto/rcc/rcc.pro
@@ -4,3 +4,9 @@ TARGET = tst_rcc
SOURCES += tst_rcc.cpp
+wince* {
+ DEFINES += SRCDIR=\\\"\\\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
diff --git a/tests/auto/rcc/tst_rcc.cpp b/tests/auto/rcc/tst_rcc.cpp
index c9e3d76..2fe0dc4 100644
--- a/tests/auto/rcc/tst_rcc.cpp
+++ b/tests/auto/rcc/tst_rcc.cpp
@@ -102,7 +102,7 @@ void tst_rcc::rcc_data()
QTest::addColumn<QString>("qrcfile");
QTest::addColumn<QString>("expected");
- QTest::newRow("images") << "data" << "images.qrc" << "images.expected";
+ QTest::newRow("images") << SRCDIR "data" << "images.qrc" << "images.expected";
}
void tst_rcc::rcc()
diff --git a/tests/auto/windowsmobile/test/test.pro b/tests/auto/windowsmobile/test/test.pro
index b7f65a9..61e275d 100644
--- a/tests/auto/windowsmobile/test/test.pro
+++ b/tests/auto/windowsmobile/test/test.pro
@@ -5,7 +5,7 @@ HEADERS += ddhelper.h
SOURCES += tst_windowsmobile.cpp ddhelper.cpp
RESOURCES += windowsmobile.qrc
-TARGET = tst_windowsmobile
+TARGET = ../tst_windowsmobile
wincewm*: {
addFiles.sources = $$OUT_PWD/../testQMenuBar/*.exe
diff --git a/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro b/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro
index 6dd288b..87986e4 100644
--- a/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro
+++ b/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro
@@ -1,2 +1,3 @@
SOURCES += main.cpp
-DESTDIR = ./
+TARGET = ../testQMenuBar
+
diff --git a/tests/manual/keypadnavigation/keypadnavigation.ui b/tests/manual/keypadnavigation/keypadnavigation.ui
index 039889b..8b456d9 100644
--- a/tests/manual/keypadnavigation/keypadnavigation.ui
+++ b/tests/manual/keypadnavigation/keypadnavigation.ui
@@ -1060,75 +1060,100 @@ As a reward you can try out the QDial, below.</string>
</widget>
<widget class="QWidget" name="m_pageDialogs">
<layout class="QVBoxLayout" name="verticalLayout_13">
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="QPushButton" name="m_buttonGetOpenFileName">
- <property name="text">
- <string>getOpenFileName()</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="m_buttonGetSaveFileName">
- <property name="text">
- <string>getSaveFileName()</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="m_buttonGetExistingDirectory">
- <property name="text">
- <string>getExistingDirectory()</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="m_buttonGetColor">
- <property name="text">
- <string>getColor()</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="m_buttonGetFont">
- <property name="text">
- <string>getFont()</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="m_buttonQuestion">
- <property name="text">
- <string>question()</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="m_buttonAboutQt">
- <property name="text">
- <string>aboutQt()</string>
+ <widget class="QScrollArea" name="scrollArea_5">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
</property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="m_buttonGetItem">
- <property name="text">
- <string>getItem()</string>
+ <property name="widgetResizable">
+ <bool>true</bool>
</property>
+ <widget class="QWidget" name="scrollAreaWidgetContents_5">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>264</width>
+ <height>356</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_14">
+ <item>
+ <widget class="QPushButton" name="m_buttonGetOpenFileName">
+ <property name="text">
+ <string>getOpenFileName()</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="m_buttonGetSaveFileName">
+ <property name="text">
+ <string>getSaveFileName()</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="m_buttonGetExistingDirectory">
+ <property name="text">
+ <string>getExistingDirectory()</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="m_buttonGetColor">
+ <property name="text">
+ <string>getColor()</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="m_buttonGetFont">
+ <property name="text">
+ <string>getFont()</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="m_buttonQuestion">
+ <property name="text">
+ <string>question()</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="m_buttonAboutQt">
+ <property name="text">
+ <string>aboutQt()</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="m_buttonGetItem">
+ <property name="text">
+ <string>getItem()</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>103</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
- <item>
- <spacer name="verticalSpacer_3">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>104</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
</widget>
@@ -1155,7 +1180,7 @@ As a reward you can try out the QDial, below.</string>
<addaction name="m_actionLayoutChaos"/>
<addaction name="m_actionLayoutDialogs"/>
</widget>
- <widget class="QMenu" name="menuNavigation_mode">
+ <widget class="QMenu" name="m_menuNavigation_mode">
<property name="title">
<string>Navigation mode</string>
</property>
@@ -1166,7 +1191,7 @@ As a reward you can try out the QDial, below.</string>
<addaction name="m_actionModeCursorForceVisible"/>
</widget>
<addaction name="menuUi_layout"/>
- <addaction name="menuNavigation_mode"/>
+ <addaction name="m_menuNavigation_mode"/>
</widget>
<action name="m_actionLayoutVerticalSimple">
<property name="text">
diff --git a/tests/manual/keypadnavigation/main.cpp b/tests/manual/keypadnavigation/main.cpp
index d1cc8a7..84b3d78 100644
--- a/tests/manual/keypadnavigation/main.cpp
+++ b/tests/manual/keypadnavigation/main.cpp
@@ -70,6 +70,7 @@ public:
}
connect(&m_layoutSignalMapper, SIGNAL(mapped(QWidget*)), ui->m_stackWidget, SLOT(setCurrentWidget(QWidget*)));
+#ifdef QT_KEYPAD_NAVIGATION
const struct {
QObject *action;
Qt::NavigationMode mode;
@@ -85,6 +86,9 @@ public:
m_modeSignalMapper.setMapping(modeMappings[i].action, int(modeMappings[i].mode));
}
connect(&m_modeSignalMapper, SIGNAL(mapped(int)), SLOT(setNavigationMode(int)));
+#else // QT_KEYPAD_NAVIGATION
+ ui->m_menuNavigation_mode->deleteLater();
+#endif // QT_KEYPAD_NAVIGATION
const struct {
QObject *button;
@@ -112,10 +116,12 @@ public:
}
protected slots:
+#ifdef QT_KEYPAD_NAVIGATION
void setNavigationMode(int mode)
{
QApplication::setNavigationMode(Qt::NavigationMode(mode));
}
+#endif // QT_KEYPAD_NAVIGATION
void openDialog(int dialog)
{
@@ -163,7 +169,9 @@ private:
Ui_KeypadNavigation *ui;
QSignalMapper m_layoutSignalMapper;
+#ifdef QT_KEYPAD_NAVIGATION
QSignalMapper m_modeSignalMapper;
+#endif // QT_KEYPAD_NAVIGATION
QSignalMapper m_dialogSignalMapper;
};