summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-15 08:09:50 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-15 08:09:50 +0100
commit80bf4bfe3df425962192118d4357acc144f6aef8 (patch)
tree79e4b6a00d6bf68be62fe157878f38dcd782a475 /tests/auto
parentac8a3b948da1980bc59bae3fc76d20b5b45662a0 (diff)
parent8c2b4266002736da499d169a0da187e5cdc5381a (diff)
Merge remote-tracking branch 'origin/5.6.0' into 5.6
Diffstat (limited to 'tests/auto')
-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/text/qglyphrun/tst_qglyphrun.cpp29
3 files changed, 30 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 86dd8c4daf..ff15dc5b6d 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -1482,6 +1482,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/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index 5506c96221..78cb06986f 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -70,6 +70,7 @@ private slots:
void setRawDataAndGetAsVector();
void boundingRect();
void mixedScripts();
+ void multiLineBoundingRect();
private:
int m_testFontId;
@@ -735,6 +736,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)