summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-07-29 07:46:48 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-07-29 07:46:48 (GMT)
commit940b5b23268193d58d7e229bf97a22276098790b (patch)
treeaf532e70e2646012b6a856bab48a105389bc2098 /tests
parentd1e1f49ea0b742fd655112fdb30f5751e142a766 (diff)
parent0041606aefae5da0ff6c8187540f3eff33cbb643 (diff)
downloadQt-940b5b23268193d58d7e229bf97a22276098790b.zip
Qt-940b5b23268193d58d7e229bf97a22276098790b.tar.gz
Qt-940b5b23268193d58d7e229bf97a22276098790b.tar.bz2
Merge remote branch 'origin/4.6' into 4.7-from-4.6
Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebKit/qt/ChangeLog src/gui/itemviews/qlistview.cpp tests/auto/qlistview/tst_qlistview.cpp tests/auto/qnetworkreply/test/test.pro tests/auto/qsocks5socketengine/qsocks5socketengine.pro
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp51
-rw-r--r--tests/auto/qnetworkreply/test/test.pro2
-rw-r--r--tests/auto/qsocks5socketengine/qsocks5socketengine.pro2
-rw-r--r--tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp27
-rw-r--r--tests/benchmarks/network/network.pro2
5 files changed, 79 insertions, 5 deletions
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index 5112ee0..425ac89 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -45,6 +45,7 @@
#include <qabstractitemmodel.h>
#include <qapplication.h>
#include <qlistview.h>
+#include <qlistwidget.h>
#include <qitemdelegate.h>
#include <qstandarditemmodel.h>
#include <qstringlistmodel.h>
@@ -125,6 +126,8 @@ private slots:
void taskQTBUG_5877_skippingItemInPageDownUp();
void taskQTBUG_9455_wrongScrollbarRanges();
void styleOptionViewItem();
+ void taskQTBUG_12308_artihmeticException();
+ void taskQTBUG_12308_wrongFlowLayout();
};
// Testing get/set functions
@@ -2002,5 +2005,53 @@ void tst_QListView::styleOptionViewItem()
QApplication::processEvents();
}
+void tst_QListView::taskQTBUG_12308_artihmeticException()
+{
+ QListWidget lw;
+ lw.setLayoutMode(QListView::Batched);
+ lw.setViewMode(QListView::IconMode);
+ for (int i = 0; i < lw.batchSize() + 1; i++) {
+ QListWidgetItem *item = new QListWidgetItem();
+ item->setText(QString("Item %L1").arg(i));
+ lw.addItem(item);
+ item->setHidden(true);
+ }
+ lw.show();
+ QTest::qWaitForWindowShown(&lw);
+ // No crash, it's all right.
+}
+
+class Delegate12308 : public QStyledItemDelegate
+{
+ Q_OBJECT
+public:
+ Delegate12308(QObject *parent = 0) : QStyledItemDelegate(parent)
+ { }
+
+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+ {
+ QVERIFY(option.rect.topLeft() != QPoint(-1, -1));
+ QStyledItemDelegate::paint(painter, option, index);
+ }
+};
+
+void tst_QListView::taskQTBUG_12308_wrongFlowLayout()
+{
+ QListWidget lw;
+ Delegate12308 delegate;
+ lw.setLayoutMode(QListView::Batched);
+ lw.setViewMode(QListView::IconMode);
+ lw.setItemDelegate(&delegate);
+ for (int i = 0; i < lw.batchSize() + 1; i++) {
+ QListWidgetItem *item = new QListWidgetItem();
+ item->setText(QString("Item %L1").arg(i));
+ lw.addItem(item);
+ if (!item->text().contains(QString::fromAscii("1")))
+ item->setHidden(true);
+ }
+ lw.show();
+ QTest::qWaitForWindowShown(&lw);
+}
+
QTEST_MAIN(tst_QListView)
#include "tst_qlistview.moc"
diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro
index b9ece38..6e1b1e3 100644
--- a/tests/auto/qnetworkreply/test/test.pro
+++ b/tests/auto/qnetworkreply/test/test.pro
@@ -31,7 +31,7 @@ symbian:{
DEPLOYMENT += certFiles
# Symbian toolchain does not support correct include semantics
- INCPATH+=..\\..\\..\\..\\include\\QtNetwork\\private
+ INCLUDEPATH+=..\\..\\..\\..\\include\\QtNetwork\\private
# bigfile test case requires more heap
TARGET.EPOCHEAPSIZE="0x100 0x1000000"
TARGET.CAPABILITY="ALL -TCB"
diff --git a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
index 62c0c87..171d428 100644
--- a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
+++ b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
@@ -10,7 +10,7 @@ MOC_DIR=tmp
QT = core network
# Symbian toolchain does not support correct include semantics
-symbian:INCPATH+=..\\..\\..\\include\\QtNetwork\\private
+symbian:INCLUDEPATH+=..\\..\\..\\include\\QtNetwork\\private
symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
index 8a4307e..a4bfb89 100644
--- a/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
+++ b/tests/auto/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
@@ -127,16 +127,37 @@ void tst_QVideoSurfaceFormat::construct_data()
QTest::addColumn<QSize>("frameSize");
QTest::addColumn<QVideoFrame::PixelFormat>("pixelFormat");
QTest::addColumn<QAbstractVideoBuffer::HandleType>("handleType");
+ QTest::addColumn<bool>("valid");
QTest::newRow("32x32 rgb32 no handle")
<< QSize(32, 32)
<< QVideoFrame::Format_RGB32
- << QAbstractVideoBuffer::NoHandle;
+ << QAbstractVideoBuffer::NoHandle
+ << true;
QTest::newRow("1024x768 YUV444 GL texture")
<< QSize(32, 32)
<< QVideoFrame::Format_YUV444
- << QAbstractVideoBuffer::GLTextureHandle;
+ << QAbstractVideoBuffer::GLTextureHandle
+ << true;
+
+ QTest::newRow("32x32 invalid no handle")
+ << QSize(32, 32)
+ << QVideoFrame::Format_Invalid
+ << QAbstractVideoBuffer::NoHandle
+ << false;
+
+ QTest::newRow("invalid size, rgb32 no handle")
+ << QSize()
+ << QVideoFrame::Format_RGB32
+ << QAbstractVideoBuffer::NoHandle
+ << false;
+
+ QTest::newRow("0x0 rgb32 no handle")
+ << QSize(0,0)
+ << QVideoFrame::Format_RGB32
+ << QAbstractVideoBuffer::NoHandle
+ << true;
}
void tst_QVideoSurfaceFormat::construct()
@@ -144,6 +165,7 @@ void tst_QVideoSurfaceFormat::construct()
QFETCH(QSize, frameSize);
QFETCH(QVideoFrame::PixelFormat, pixelFormat);
QFETCH(QAbstractVideoBuffer::HandleType, handleType);
+ QFETCH(bool, valid);
QRect viewport(QPoint(0, 0), frameSize);
@@ -154,6 +176,7 @@ void tst_QVideoSurfaceFormat::construct()
QCOMPARE(format.frameSize(), frameSize);
QCOMPARE(format.frameWidth(), frameSize.width());
QCOMPARE(format.frameHeight(), frameSize.height());
+ QCOMPARE(format.isValid(), valid);
QCOMPARE(format.viewport(), viewport);
QCOMPARE(format.scanLineDirection(), QVideoSurfaceFormat::TopToBottom);
QCOMPARE(format.frameRate(), 0.0);
diff --git a/tests/benchmarks/network/network.pro b/tests/benchmarks/network/network.pro
index 4e83db2..ea0f821 100644
--- a/tests/benchmarks/network/network.pro
+++ b/tests/benchmarks/network/network.pro
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
-SUBDIRS = \
+SUBDIRS = \
access \
kernel \
socket