summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-20 01:01:00 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-02-20 09:51:12 +0100
commit035f934d7a798e97bf0213a5d42a3d511132f03d (patch)
tree89aa6efdc86864ce479cddca6b9c4ba523c2754a /tests/auto/gui
parentf4cc23cffbe3005f0a522cac938695e87ecd6407 (diff)
parentda4ab444ffac37514435364d4d3f0ad59d4f9bc3 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp Added tests/auto/testlib/selftests/expected_crashes_5.txt to work round the output of the crashes test (which exercises UB, see QTBUG-73903) being truncated on one test platform. Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp2
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp55
-rw-r--r--tests/auto/gui/qopengl/qopengl.pro2
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp2
-rw-r--r--tests/auto/gui/text/qrawfont/BLACKLIST3
-rw-r--r--tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp22
-rw-r--r--tests/auto/gui/text/qtexttable/tst_qtexttable.cpp6
7 files changed, 87 insertions, 5 deletions
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index 46a2d73ece..13d0618bd9 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -1291,7 +1291,7 @@ void tst_QColor::toCmyk_data()
<< QColor::fromHslF(180./360., 1., 0.5, 1.0);
QTest::newRow("data1")
- << QColor::fromCmyk(255, 255, 255, 255)
+ << QColor::fromCmyk(0, 0, 0, 255)
<< QColor::fromRgb(0, 0, 0)
<< QColor::fromRgb(0, 0, 0).toHsv()
<< QColor::fromRgb(0, 0, 0).toHsl();
diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp
index 5256fbd1dc..24c4583819 100644
--- a/tests/auto/gui/painting/qregion/tst_qregion.cpp
+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp
@@ -84,6 +84,8 @@ private slots:
#endif
void regionFromPath();
+ void scaleRegions_data();
+ void scaleRegions();
#ifdef QT_BUILD_INTERNAL
void regionToPath_data();
@@ -973,6 +975,59 @@ void tst_QRegion::regionFromPath()
}
}
+void tst_QRegion::scaleRegions_data()
+{
+ QTest::addColumn<qreal>("scale");
+ QTest::addColumn<QVector<QRect>>("inputRects");
+ QTest::addColumn<QVector<QRect>>("expectedRects");
+
+ QTest::newRow("1.0 single") << 1.0
+ << QVector<QRect>{ QRect(10, 10, 20, 20) }
+ << QVector<QRect>{ QRect(10, 10, 20, 20) };
+ QTest::newRow("1.0 multi") << 1.0
+ << QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
+ << QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) };
+ QTest::newRow("2.0 single") << 2.0
+ << QVector<QRect>{ QRect(10, 10, 20, 20) }
+ << QVector<QRect>{ QRect(20, 20, 40, 40) };
+ QTest::newRow("2.0 multi") << 2.0
+ << QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
+ << QVector<QRect>{ QRect(20, 20, 40, 40), QRect(80, 20, 40, 40) };
+ QTest::newRow("-1.0 single") << -1.0
+ << QVector<QRect>{ QRect(10, 10, 20, 20) }
+ << QVector<QRect>{ QRect(-30, -30, 20, 20) };
+ QTest::newRow("-1.0 multi") << -1.0
+ << QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
+ << QVector<QRect>{ QRect(-60, -30, 20, 20), QRect(-30, -30, 20, 20) };
+ QTest::newRow("-2.0 single") << -2.0
+ << QVector<QRect>{ QRect(10, 10, 20, 20) }
+ << QVector<QRect>{ QRect(-60, -60, 40, 40) };
+ QTest::newRow("-2.0 multi") << -2.0
+ << QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
+ << QVector<QRect>{ QRect(-120, -60, 40, 40), QRect(-60, -60, 40, 40) };
+}
+
+void tst_QRegion::scaleRegions()
+{
+ QFETCH(qreal, scale);
+ QFETCH(QVector<QRect>, inputRects);
+ QFETCH(QVector<QRect>, expectedRects);
+
+ QRegion region;
+ region.setRects(inputRects.constData(), inputRects.size());
+
+ QRegion expected(expectedRects.first());
+ expected.setRects(expectedRects.constData(), expectedRects.size());
+
+ QTransform t;
+ t.scale(scale, scale);
+
+ auto result = t.map(region);
+
+ QCOMPARE(result.rectCount(), expectedRects.size());
+ QCOMPARE(result, expected);
+}
+
Q_DECLARE_METATYPE(QPainterPath)
#ifdef QT_BUILD_INTERNAL
diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro
index d744d37280..722c99ee0b 100644
--- a/tests/auto/gui/qopengl/qopengl.pro
+++ b/tests/auto/gui/qopengl/qopengl.pro
@@ -8,4 +8,4 @@ QT += gui-private core-private testlib
SOURCES += tst_qopengl.cpp
-linux:qtConfig(xcb):qtConfig(xcb-glx):qtConfig(xcb-xlib):!qtConfig(egl): DEFINES += USE_GLX
+linux:qtConfig(xcb):qtConfig(xcb-glx-plugin): DEFINES += USE_GLX
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index f1360b9efe..ede1e58a53 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -642,6 +642,8 @@ static bool supportsInternalFboFormat(QOpenGLContext *ctx, int glFormat)
return false;
}
}
+#else
+ Q_UNUSED(glFormat);
#endif
return true;
}
diff --git a/tests/auto/gui/text/qrawfont/BLACKLIST b/tests/auto/gui/text/qrawfont/BLACKLIST
deleted file mode 100644
index c076f11635..0000000000
--- a/tests/auto/gui/text/qrawfont/BLACKLIST
+++ /dev/null
@@ -1,3 +0,0 @@
-# QTBUG-72836
-[unsupportedWritingSystem]
-windows
diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
index 08f7cf4fb2..fe0b6dae49 100644
--- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
+++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
@@ -196,6 +196,8 @@ private slots:
void css_linkPseudo();
void css_pageBreaks();
void css_cellPaddings();
+ void css_whiteSpace_data();
+ void css_whiteSpace();
void universalSelectors_data();
void universalSelectors();
void screenMedia();
@@ -1771,6 +1773,26 @@ void tst_QTextDocumentFragment::css_cellPaddings()
QCOMPARE(cell.format().toTableCellFormat().bottomPadding(), qreal(15));
}
+void tst_QTextDocumentFragment::css_whiteSpace_data()
+{
+ QTest::addColumn<QString>("htmlText");
+ QTest::addColumn<bool>("nowrap");
+
+ QTest::newRow("default") << QString("<p>Normal Text</p>") << false;
+ QTest::newRow("white-space:nowrap") << QString("<p style=white-space:nowrap>Normal Text</p>") << true;
+ QTest::newRow("white-space:pre") << QString("<p style=white-space:pre>Normal Text</p>") << true;
+}
+
+void tst_QTextDocumentFragment::css_whiteSpace()
+{
+ QFETCH(QString, htmlText);
+ QFETCH(bool, nowrap);
+
+ doc->setHtml(htmlText);
+ QCOMPARE(doc->blockCount(), 1);
+ QCOMPARE(doc->begin().blockFormat().nonBreakableLines(), nowrap);
+}
+
void tst_QTextDocumentFragment::html_blockLevelDiv()
{
const char html[] = "<div align=right><b>Hello World";
diff --git a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
index 29eef506bf..22f00c677d 100644
--- a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
@@ -431,6 +431,12 @@ void tst_QTextTable::insertRows()
table->insertRows(5, 2);
QCOMPARE(table->rows(), 7);
+ table = cursor.insertTable(5,5);
+ table->mergeCells(0,0,3,3);
+ table->insertRows(2,1);
+
+ QCOMPARE(table->rows(), 6);
+
}
void tst_QTextTable::deleteInTable()