summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-18 20:45:53 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-18 20:50:35 +0100
commit4fe2fbcf827ae6bec976b0b8dcaa5d14bd05dc33 (patch)
treed1ba753b45b09b417a9447ebdfe2fa6fc47dba69 /tests/auto/gui
parentc1da6347e8d3ba73de20ab8fb3e50ec3359b75ac (diff)
parent4889269ff0fb37130b332863e82dd7c19564116c (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/image/qimagereader/images/corrupt_clut.bmpbin0 -> 368 bytes
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp1
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST2
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp29
4 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qimagereader/images/corrupt_clut.bmp b/tests/auto/gui/image/qimagereader/images/corrupt_clut.bmp
new file mode 100644
index 0000000000..aeb063fce5
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/corrupt_clut.bmp
Binary files differ
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index 7d353dfb91..bd02dc6255 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -1477,6 +1477,7 @@ void tst_QImageReader::readCorruptImage_data()
QTest::newRow("corrupt gif") << QString("corrupt.gif") << true << QString("") << QByteArray("gif");
QTest::newRow("corrupt png") << QString("corrupt.png") << true << QString("") << QByteArray("png");
QTest::newRow("corrupt bmp") << QString("corrupt.bmp") << true << QString("") << QByteArray("bmp");
+ QTest::newRow("corrupt bmp (clut)") << QString("corrupt_clut.bmp") << true << QString("") << QByteArray("bmp");
QTest::newRow("corrupt xpm (colors)") << QString("corrupt-colors.xpm") << true
<< QString("QImage: XPM color specification is missing: bla9an.n#x")
<< QByteArray("xpm");
diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST
index 774c22a8e9..bdd27b4ea6 100644
--- a/tests/auto/gui/kernel/qwindow/BLACKLIST
+++ b/tests/auto/gui/kernel/qwindow/BLACKLIST
@@ -1,3 +1,5 @@
+[testInputEvents]
+rhel-7.1
[positioning:default]
ubuntu-14.04
[modalWindowPosition]
diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index 4b3d709812..7c60c8c9f8 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -65,6 +65,7 @@ private slots:
void setRawDataAndGetAsVector();
void boundingRect();
void mixedScripts();
+ void multiLineBoundingRect();
private:
int m_testFontId;
@@ -730,6 +731,34 @@ void tst_QGlyphRun::mixedScripts()
QCOMPARE(glyphRuns.size(), 2);
}
+void tst_QGlyphRun::multiLineBoundingRect()
+{
+ QTextLayout layout;
+ layout.setText("Foo Bar");
+ layout.beginLayout();
+
+ QTextLine line = layout.createLine();
+ line.setNumColumns(4);
+ line.setPosition(QPointF(0, 0));
+
+ line = layout.createLine();
+ line.setPosition(QPointF(0, 10));
+
+ layout.endLayout();
+
+ QCOMPARE(layout.lineCount(), 2);
+
+ QList<QGlyphRun> firstLineGlyphRuns = layout.lineAt(0).glyphRuns();
+ QList<QGlyphRun> allGlyphRuns = layout.glyphRuns();
+ QCOMPARE(firstLineGlyphRuns.size(), 1);
+ QCOMPARE(allGlyphRuns.size(), 1);
+
+ QGlyphRun firstLineGlyphRun = firstLineGlyphRuns.first();
+ QGlyphRun allGlyphRun = allGlyphRuns.first();
+
+ QVERIFY(firstLineGlyphRun.boundingRect().height() < allGlyphRun.boundingRect().height());
+}
+
#endif // QT_NO_RAWFONT
QTEST_MAIN(tst_QGlyphRun)