summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp42
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp2
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp6
-rw-r--r--tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp4
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp2
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp2
-rw-r--r--tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp46
-rw-r--r--tests/auto/gui/kernel/qpalette/tst_qpalette.cpp38
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp43
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp55
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp21
-rw-r--r--tests/auto/gui/text/qfont/qfont.pro1
-rw-r--r--tests/auto/gui/text/qfont/testfont.qrc5
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp123
-rw-r--r--tests/auto/gui/text/qfont/weirdfont.otfbin0 -> 25008 bytes
-rw-r--r--tests/auto/gui/text/qfontcache/tst_qfontcache.cpp45
-rw-r--r--tests/auto/gui/text/qglyphrun/BLACKLIST1
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp4
-rw-r--r--tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp2
-rw-r--r--tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp51
-rw-r--r--tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc2
-rw-r--r--tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astcbin0 -> 2512 bytes
-rw-r--r--tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astcbin0 -> 2512 bytes
-rw-r--r--tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp70
24 files changed, 500 insertions, 65 deletions
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 6bc27a6e16..302180586e 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -301,6 +301,8 @@ static QLatin1String formatToString(QImage::Format format)
return QLatin1String("RGBA64");
case QImage::Format_RGBA64_Premultiplied:
return QLatin1String("RGBA64pm");
+ case QImage::Format_Grayscale16:
+ return QLatin1String("Grayscale16");
default:
break;
};
@@ -2369,8 +2371,11 @@ void tst_QImage::rgbSwapped_data()
QTest::addColumn<QImage::Format>("format");
for (int i = QImage::Format_Indexed8; i < QImage::NImageFormats; ++i) {
- if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ if (i == QImage::Format_Alpha8
+ || i == QImage::Format_Grayscale8
+ || i == QImage::Format_Grayscale16) {
continue;
+ }
QTest::addRow("%s", formatToString(QImage::Format(i)).data()) << QImage::Format(i);
}
}
@@ -2615,8 +2620,11 @@ void tst_QImage::inplaceMirrored_data()
QTest::addColumn<bool>("swap_horizontal");
for (int i = QImage::Format_Mono; i < QImage::NImageFormats; ++i) {
- if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ if (i == QImage::Format_Alpha8
+ || i == QImage::Format_Grayscale8
+ || i == QImage::Format_Grayscale16) {
continue;
+ }
if (i == QImage::Format_RGB444 || i == QImage::Format_ARGB4444_Premultiplied)
continue;
const auto fmt = formatToString(QImage::Format(i));
@@ -2788,11 +2796,11 @@ void tst_QImage::genericRgbConversion_data()
QTest::addColumn<QImage::Format>("dest_format");
for (int i = QImage::Format_RGB32; i < QImage::NImageFormats; ++i) {
- if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ if (i == QImage::Format_Alpha8)
continue;
const QLatin1String formatI = formatToString(QImage::Format(i));
for (int j = QImage::Format_RGB32; j < QImage::NImageFormats; ++j) {
- if (j == QImage::Format_Alpha8 || j == QImage::Format_Grayscale8)
+ if (j == QImage::Format_Alpha8)
continue;
if (i == j)
continue;
@@ -2808,6 +2816,9 @@ void tst_QImage::genericRgbConversion()
QFETCH(QImage::Format, format);
QFETCH(QImage::Format, dest_format);
+ bool srcGrayscale = format == QImage::Format_Grayscale8 || format == QImage::Format_Grayscale16;
+ bool dstGrayscale = dest_format == QImage::Format_Grayscale8 || dest_format == QImage::Format_Grayscale16;
+
QImage image(16, 16, format);
for (int i = 0; i < image.height(); ++i)
@@ -2819,8 +2830,12 @@ void tst_QImage::genericRgbConversion()
for (int i = 0; i < imageConverted.height(); ++i) {
for (int j = 0; j < imageConverted.width(); ++j) {
QRgb convertedColor = imageConverted.pixel(j,i);
- QCOMPARE(qRed(convertedColor) & 0xF0, j * 16);
- QCOMPARE(qGreen(convertedColor) & 0xF0, i * 16);
+ if (srcGrayscale || dstGrayscale) {
+ QVERIFY(qAbs(qGray(convertedColor) - qGray(qRgb(j*16, i*16, 0))) < 15);
+ } else {
+ QCOMPARE(qRed(convertedColor) & 0xF0, j * 16);
+ QCOMPARE(qGreen(convertedColor) & 0xF0, i * 16);
+ }
}
}
}
@@ -2831,11 +2846,17 @@ void tst_QImage::inplaceRgbConversion_data()
QTest::addColumn<QImage::Format>("dest_format");
for (int i = QImage::Format_RGB32; i < QImage::NImageFormats; ++i) {
- if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ if (i == QImage::Format_Alpha8
+ || i == QImage::Format_Grayscale8
+ || i == QImage::Format_Grayscale16) {
continue;
+ }
for (int j = QImage::Format_RGB32; j < QImage::NImageFormats; ++j) {
- if (j == QImage::Format_Alpha8 || j == QImage::Format_Grayscale8)
+ if (j == QImage::Format_Alpha8
+ || j == QImage::Format_Grayscale8
+ || j == QImage::Format_Grayscale16) {
continue;
+ }
if (i == j)
continue;
QTest::addRow("%s -> %s", formatToString(QImage::Format(i)).data(), formatToString(QImage::Format(j)).data())
@@ -3005,8 +3026,11 @@ void tst_QImage::invertPixelsRGB_data()
QTest::addColumn<QImage::Format>("image_format");
for (int i = QImage::Format_RGB32; i < QImage::NImageFormats; ++i) {
- if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ if (i == QImage::Format_Alpha8
+ || i == QImage::Format_Grayscale8
+ || i == QImage::Format_Grayscale16) {
continue;
+ }
QTest::addRow("%s", formatToString(QImage::Format(i)).data()) << QImage::Format(i);
}
}
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index c2ec5b8925..1cf01133b2 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -525,7 +525,7 @@ void tst_QImageReader::imageFormat_data()
QTest::newRow("png") << QString("kollada.png") << QByteArray("png") << QImage::Format_ARGB32;
QTest::newRow("png-2") << QString("YCbCr_cmyk.png") << QByteArray("png") << QImage::Format_RGB32;
QTest::newRow("png-3") << QString("kollada-16bpc.png") << QByteArray("png") << QImage::Format_RGBA64;
- QTest::newRow("png-4") << QString("basn0g16.png") << QByteArray("png") << QImage::Format_RGBX64; // Grayscale16
+ QTest::newRow("png-4") << QString("basn0g16.png") << QByteArray("png") << QImage::Format_Grayscale16;
QTest::newRow("png-5") << QString("basn2c16.png") << QByteArray("png") << QImage::Format_RGBX64;
QTest::newRow("png-6") << QString("basn4a16.png") << QByteArray("png") << QImage::Format_RGBA64; // Grayscale16Alpha16
QTest::newRow("png-7") << QString("basn6a16.png") << QByteArray("png") << QImage::Format_RGBA64;
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index 77851cd7d0..aaa8475c74 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -239,7 +239,7 @@ void tst_QImageWriter::writeImage2_data()
// QLatin1String("jpeg"),
};
- QImage image0(70, 70, QImage::Format_ARGB32);
+ QImage image0(70, 70, QImage::Format_RGB32);
image0.fill(QColor(Qt::red).rgb());
QImage::Format imgFormat = QImage::Format_Mono;
@@ -304,10 +304,10 @@ void tst_QImageWriter::writeImage2()
if (!equalImageContents(written, image)) {
qDebug() << "image" << image.format() << image.width()
<< image.height() << image.depth()
- << hex << image.pixel(0, 0);
+ << image.pixelColor(0, 0);
qDebug() << "written" << written.format() << written.width()
<< written.height() << written.depth()
- << hex << written.pixel(0, 0);
+ << written.pixelColor(0, 0);
}
QVERIFY(equalImageContents(written, image));
diff --git a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
index d19aa9b54f..2deb84fa5f 100644
--- a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
@@ -202,9 +202,7 @@ void tst_QStandardItem::getSetData()
QCOMPARE(qvariant_cast<QSize>(item.data(Qt::SizeHintRole)), sizeHint);
QCOMPARE(qvariant_cast<QFont>(item.data(Qt::FontRole)), font);
QCOMPARE(qvariant_cast<int>(item.data(Qt::TextAlignmentRole)), int(textAlignment));
- QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::BackgroundColorRole)), QBrush(backgroundColor));
QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::BackgroundRole)), QBrush(backgroundColor));
- QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::TextColorRole)), QBrush(textColor));
QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::ForegroundRole)), QBrush(textColor));
QCOMPARE(qvariant_cast<int>(item.data(Qt::CheckStateRole)), int(checkState));
QCOMPARE(qvariant_cast<QString>(item.data(Qt::AccessibleTextRole)), accessibleText);
@@ -236,9 +234,7 @@ void tst_QStandardItem::getSetData()
QCOMPARE(item.data(Qt::SizeHintRole), QVariant());
QCOMPARE(item.data(Qt::FontRole), QVariant());
QCOMPARE(item.data(Qt::TextAlignmentRole), QVariant());
- QCOMPARE(item.data(Qt::BackgroundColorRole), QVariant());
QCOMPARE(item.data(Qt::BackgroundRole), QVariant());
- QCOMPARE(item.data(Qt::TextColorRole), QVariant());
QCOMPARE(item.data(Qt::ForegroundRole), QVariant());
QCOMPARE(item.data(Qt::CheckStateRole), QVariant());
QCOMPARE(item.data(Qt::AccessibleTextRole), QVariant());
diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
index e2d7a41bd1..550f70890e 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -1160,7 +1160,7 @@ void tst_QStandardItemModel::getSetItemData()
QColor backgroundColor(Qt::blue);
roles.insert(Qt::BackgroundRole, backgroundColor);
QColor textColor(Qt::green);
- roles.insert(Qt::TextColorRole, textColor);
+ roles.insert(Qt::ForegroundRole, textColor);
Qt::CheckState checkState(Qt::PartiallyChecked);
roles.insert(Qt::CheckStateRole, int(checkState));
QLatin1String accessibleText("accessibleText");
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index 993ebbaac6..bff9f7d0e0 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -215,7 +215,7 @@ static bool runHelper(const QString &program, const QStringList &arguments, QByt
{
#if QT_CONFIG(process)
QProcess process;
- process.setReadChannelMode(QProcess::ForwardedChannels);
+ process.setProcessChannelMode(QProcess::ForwardedChannels);
process.start(program, arguments);
if (!process.waitForStarted()) {
*errorMessage = "Unable to start '" + program.toLocal8Bit() + " ': "
diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index cca0e95c29..b2572188b9 100644
--- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -49,6 +49,8 @@ private slots:
void construct();
void constructCopy_data();
void constructCopy();
+ void saveAndLoadBuiltin_data();
+ void saveAndLoadBuiltin();
};
#define FOR_EACH_GUI_METATYPE_BASE(F) \
@@ -442,5 +444,49 @@ FOR_EACH_GUI_METATYPE(RETURN_CONSTRUCT_COPY_FUNCTION)
TypeTestFunctionGetter::get(type)();
}
+template <typename T>
+struct StreamingTraits
+{
+ // Streamable by default, as currently all gui built-in types are streamable
+ enum { isStreamable = 1 };
+};
+
+void tst_QGuiMetaType::saveAndLoadBuiltin_data()
+{
+ QTest::addColumn<int>("type");
+ QTest::addColumn<bool>("isStreamable");
+
+#define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \
+ QTest::newRow(#RealType) << MetaTypeId << bool(StreamingTraits<RealType>::isStreamable);
+ QT_FOR_EACH_STATIC_GUI_CLASS(ADD_METATYPE_TEST_ROW)
+#undef ADD_METATYPE_TEST_ROW
+}
+
+void tst_QGuiMetaType::saveAndLoadBuiltin()
+{
+ QFETCH(int, type);
+ QFETCH(bool, isStreamable);
+
+ void *value = QMetaType::create(type);
+
+ QByteArray ba;
+ QDataStream stream(&ba, QIODevice::ReadWrite);
+ QCOMPARE(QMetaType::save(stream, type, value), isStreamable);
+ QCOMPARE(stream.status(), QDataStream::Ok);
+
+ if (isStreamable)
+ QVERIFY(QMetaType::load(stream, type, value));
+
+ stream.device()->seek(0);
+ stream.resetStatus();
+ QCOMPARE(QMetaType::load(stream, type, value), isStreamable);
+ QCOMPARE(stream.status(), QDataStream::Ok);
+
+ if (isStreamable)
+ QVERIFY(QMetaType::load(stream, type, value));
+
+ QMetaType::destroy(type, value);
+}
+
QTEST_MAIN(tst_QGuiMetaType)
#include "tst_qguimetatype.moc"
diff --git a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
index a0ac1b3631..7f29b1c24e 100644
--- a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
+++ b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
@@ -37,6 +37,7 @@ class tst_QPalette : public QObject
private Q_SLOTS:
void roleValues_data();
void roleValues();
+ void resolve();
void copySemantics();
void moveSemantics();
void setBrush();
@@ -80,6 +81,43 @@ void tst_QPalette::roleValues()
QCOMPARE(role, value);
}
+void tst_QPalette::resolve()
+{
+ QPalette p1;
+ p1.setBrush(QPalette::WindowText, Qt::green);
+ p1.setBrush(QPalette::Button, Qt::green);
+
+ QVERIFY(p1.isBrushSet(QPalette::Active, QPalette::WindowText));
+ QVERIFY(p1.isBrushSet(QPalette::Active, QPalette::Button));
+
+ QPalette p2;
+ p2.setBrush(QPalette::WindowText, Qt::red);
+
+ QVERIFY(p2.isBrushSet(QPalette::Active, QPalette::WindowText));
+ QVERIFY(!p2.isBrushSet(QPalette::Active, QPalette::Button));
+
+ QPalette p1ResolvedTo2 = p1.resolve(p2);
+ // p1ResolvedTo2 gets everything from p1 and nothing copied from p2 because
+ // it already has a WindowText. That is two brushes, and to the same value
+ // as p1.
+ QCOMPARE(p1ResolvedTo2, p1);
+ QVERIFY(p1ResolvedTo2.isBrushSet(QPalette::Active, QPalette::WindowText));
+ QCOMPARE(p1.windowText(), p1ResolvedTo2.windowText());
+ QVERIFY(p1ResolvedTo2.isBrushSet(QPalette::Active, QPalette::Button));
+ QCOMPARE(p1.button(), p1ResolvedTo2.button());
+
+ QPalette p2ResolvedTo1 = p2.resolve(p1);
+ // p2ResolvedTo1 gets the WindowText set, and to the same value as the
+ // original p2, however, Button gets set from p1.
+ QVERIFY(p2ResolvedTo1.isBrushSet(QPalette::Active, QPalette::WindowText));
+ QCOMPARE(p2.windowText(), p2ResolvedTo1.windowText());
+ QVERIFY(p2ResolvedTo1.isBrushSet(QPalette::Active, QPalette::Button));
+ QCOMPARE(p1.button(), p2ResolvedTo1.button());
+
+ QVERIFY(p2ResolvedTo1 != p1);
+ QVERIFY(p2ResolvedTo1 != p2);
+}
+
void tst_QPalette::copySemantics()
{
QPalette src(Qt::red), dst;
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 16215714f3..69c961c1a1 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -43,6 +43,8 @@ public slots:
void cleanupTestCase();
private slots:
void getSetCheck();
+ void clear();
+ void reserveAndCapacity();
void swap();
void contains_QPointF_data();
@@ -148,6 +150,47 @@ void tst_QPainterPath::swap()
QCOMPARE(p2.boundingRect().toRect(), QRect( 0, 0,10,10));
}
+void tst_QPainterPath::clear()
+{
+ QPainterPath p1;
+ QPainterPath p2;
+ p1.clear();
+ QCOMPARE(p1, p2);
+
+ p1.addRect(0, 0, 10, 10);
+ p1.clear();
+ QCOMPARE(p1, p2);
+
+ QCOMPARE(p1.fillRule(), Qt::OddEvenFill);
+ p1.setFillRule(Qt::WindingFill);
+ p1.clear();
+ QCOMPARE(p1.fillRule(), Qt::WindingFill);
+}
+
+void tst_QPainterPath::reserveAndCapacity()
+{
+ QPainterPath p;
+ QVERIFY(p.capacity() == 0);
+
+ p.addRect(0, 0, 10, 10);
+ QVERIFY(p.capacity() > 0);
+
+ p.clear();
+ QVERIFY(p.capacity() > 0);
+
+ p = QPainterPath{};
+ QVERIFY(p.capacity() == 0);
+
+ p.moveTo(100, 100);
+ QVERIFY(p.capacity() > 1);
+
+ p.reserve(1000);
+ QVERIFY(p.capacity() >= 1000);
+
+ p.reserve(0);
+ QVERIFY(p.capacity() >= 1000);
+}
+
Q_DECLARE_METATYPE(QPainterPath)
void tst_QPainterPath::currentPosition()
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/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
index cfd24a8701..7dbeb13aa7 100644
--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
@@ -835,17 +835,32 @@ void tst_QCssParser::colorValue_data()
QTest::newRow("hexcolor") << "color: #12af0e" << QColor(0x12, 0xaf, 0x0e);
QTest::newRow("functional1") << "color: rgb(21, 45, 73)" << QColor(21, 45, 73);
QTest::newRow("functional2") << "color: rgb(100%, 0%, 100%)" << QColor(0xff, 0, 0xff);
+ QTest::newRow("rgb") << "color: rgb(10, 20, 30)" << QColor(10, 20, 30);
QTest::newRow("rgba") << "color: rgba(10, 20, 30, 40)" << QColor(10, 20, 30, 40);
QTest::newRow("rgbaf") << "color: rgba(10, 20, 30, 0.5)" << QColor(10, 20, 30, 127);
- QTest::newRow("rgb") << "color: rgb(10, 20, 30, 40)" << QColor(10, 20, 30, 40);
- QTest::newRow("hsl") << "color: hsv(10, 20, 30)" << QColor::fromHsv(10, 20, 30, 255);
- QTest::newRow("hsla") << "color: hsva(10, 20, 30, 40)" << QColor::fromHsv(10, 20, 30, 40);
+ QTest::newRow("hsv") << "color: hsv(10, 20, 30)" << QColor::fromHsv(10, 20, 30);
+ QTest::newRow("hsva") << "color: hsva(10, 20, 30, 40)" << QColor::fromHsv(10, 20, 30, 40);
+ // the percent and float values are well chosen to not get in trouble due to rounding errors
+ QTest::newRow("hsva-percent") << "color: hsva(100%, 20%, 40%, 60%)" << QColor::fromHsv(359, 51, 102, 153);
+ QTest::newRow("hsva-float") << "color: hsva(180, 20%, 40%, 0.6)" << QColor::fromHsvF(0.5, 0.2, 0.4, 0.6);
+ QTest::newRow("hsl") << "color: hsl(60, 100%, 50%)" << QColor::fromHsl(60., 255, 127);
+ QTest::newRow("hsla") << "color: hsla(240, 255, 127, 192)" << QColor::fromHsl(240, 255, 127, 192);
+ QTest::newRow("hsla-percent") << "color: hsla(100%, 80%, 40%, 0%)" << QColor::fromHsl(359, 204, 102, 0);
+ QTest::newRow("hsla-float") << "color: hsla(252, 40%, 60%, 0.2)" << QColor::fromHslF(0.7, 0.4, 0.6, 0.2);
QTest::newRow("invalid1") << "color: rgb(why, does, it, always, rain, on, me)" << QColor();
QTest::newRow("invalid2") << "color: rgba(i, meant, norway)" << QColor();
QTest::newRow("invalid3") << "color: rgb(21)" << QColor();
+ QTest::newRow("invalid4") << "color: rgbx(1, 2, 3)" << QColor();
+ QTest::newRow("invalid5") << "color: rgbax(1, 2, 3, 4)" << QColor();
+ QTest::newRow("invalid6") << "color: hsv(360, 0, 0)" << QColor();
+ QTest::newRow("invalid7") << "color: hsla(1, a, 1, 21)" << QColor();
QTest::newRow("role") << "color: palette(base)" << qApp->palette().color(QPalette::Base);
QTest::newRow("role2") << "color: palette( window-text ) " << qApp->palette().color(QPalette::WindowText);
QTest::newRow("transparent") << "color: transparent" << QColor(Qt::transparent);
+
+ // ### Qt6: no longer valid
+ QTest::newRow("rgb-invalid") << "color: rgb(10, 20, 30, 40)" << QColor(10, 20, 30, 40);
+ QTest::newRow("rgba-invalid") << "color: rgba(10, 20, 30)" << QColor(10, 20, 30, 255);
}
void tst_QCssParser::colorValue()
diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro
index 048d952faf..96cd4cfdab 100644
--- a/tests/auto/gui/text/qfont/qfont.pro
+++ b/tests/auto/gui/text/qfont/qfont.pro
@@ -4,3 +4,4 @@ QT += testlib
QT += core-private gui-private
qtHaveModule(widgets): QT += widgets
SOURCES += tst_qfont.cpp
+RESOURCES += testfont.qrc
diff --git a/tests/auto/gui/text/qfont/testfont.qrc b/tests/auto/gui/text/qfont/testfont.qrc
new file mode 100644
index 0000000000..cf51e4a2b4
--- /dev/null
+++ b/tests/auto/gui/text/qfont/testfont.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>weirdfont.otf</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 8090f38a2c..9acf877790 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -66,6 +66,12 @@ private slots:
void fromStringWithoutStyleName();
void sharing();
+ void familyNameWithCommaQuote_data();
+ void familyNameWithCommaQuote();
+ void setFamilies_data();
+ void setFamilies();
+ void setFamiliesAndFamily_data();
+ void setFamiliesAndFamily();
};
// Testing get/set functions
@@ -116,6 +122,14 @@ void tst_QFont::exactMatch()
QVERIFY(!QFont("sans-serif").exactMatch());
QVERIFY(!QFont("serif").exactMatch());
QVERIFY(!QFont("monospace").exactMatch());
+
+ font.setFamilies(QStringList() << "BogusFont");
+ QVERIFY(!font.exactMatch());
+ QVERIFY(!QFont("sans").exactMatch());
+ QVERIFY(!QFont("sans-serif").exactMatch());
+ QVERIFY(!QFont("serif").exactMatch());
+ QVERIFY(!QFont("monospace").exactMatch());
+
}
void tst_QFont::italicOblique()
@@ -277,6 +291,12 @@ void tst_QFont::resolve()
QCOMPARE(f4.pointSize(), 45);
f4 = f4.resolve(f3);
QCOMPARE(f4.pointSize(), 55);
+
+ QFont font5, font6;
+ const QStringList fontFamilies = { QStringLiteral("Arial") };
+ font5.setFamilies(fontFamilies);
+ font6 = font6.resolve(font5);
+ QCOMPARE(font6.families(), fontFamilies);
}
#ifndef QT_NO_WIDGETS
@@ -624,5 +644,108 @@ void tst_QFont::sharing()
QVERIFY(QFontPrivate::get(f2)->engineData != QFontPrivate::get(f)->engineData);
}
+void tst_QFont::familyNameWithCommaQuote_data()
+{
+ QTest::addColumn<QString>("familyName");
+ QTest::addColumn<QString>("chosenFamilyName");
+
+ const QString standardFont(QFont().defaultFamily());
+ if (standardFont.isEmpty())
+ QSKIP("No default font available on the system");
+ const QString weirdFont(QLatin1String("'My, weird'' font name',"));
+ const QString commaSeparated(standardFont + QLatin1String(",Times New Roman"));
+ const QString commaSeparatedWeird(weirdFont + QLatin1String(",") + standardFont);
+ const QString commaSeparatedBogus(QLatin1String("BogusFont,") + standardFont);
+
+ QTest::newRow("standard") << standardFont << standardFont;
+ QTest::newRow("weird") << weirdFont << weirdFont;
+ QTest::newRow("commaSeparated") << commaSeparated << standardFont;
+ QTest::newRow("commaSeparatedWeird") << commaSeparatedWeird << weirdFont;
+ QTest::newRow("commaSeparatedBogus") << commaSeparatedBogus << standardFont;
+}
+
+void tst_QFont::familyNameWithCommaQuote()
+{
+ QFETCH(QString, familyName);
+ QFETCH(QString, chosenFamilyName);
+
+ const int weirdFontId = QFontDatabase::addApplicationFont(":/weirdfont.otf");
+
+ QVERIFY(weirdFontId != -1);
+ QFont f(familyName);
+ QCOMPARE(f.family(), familyName);
+ QCOMPARE(QFontInfo(f).family(), chosenFamilyName);
+
+ QFontDatabase::removeApplicationFont(weirdFontId);
+}
+
+void tst_QFont::setFamilies_data()
+{
+ QTest::addColumn<QStringList>("families");
+ QTest::addColumn<QString>("chosenFamilyName");
+
+ const QString weirdFont(QLatin1String("'My, weird'' font name',"));
+ const QString standardFont(QFont().defaultFamily());
+ if (standardFont.isEmpty())
+ QSKIP("No default font available on the system");
+
+ QTest::newRow("standard") << (QStringList() << standardFont) << standardFont;
+ QTest::newRow("weird") << (QStringList() << weirdFont) << weirdFont;
+ QTest::newRow("standard-weird") << (QStringList() << standardFont << weirdFont) << standardFont;
+ QTest::newRow("weird-standard") << (QStringList() << weirdFont << standardFont) << weirdFont;
+ QTest::newRow("nonexist-weird") << (QStringList() << "NonExistentFont" << weirdFont) << weirdFont;
+}
+
+void tst_QFont::setFamilies()
+{
+ QFETCH(QStringList, families);
+ QFETCH(QString, chosenFamilyName);
+
+ const int weirdFontId = QFontDatabase::addApplicationFont(":/weirdfont.otf");
+
+ QVERIFY(weirdFontId != -1);
+ QFont f;
+ f.setFamilies(families);
+ QCOMPARE(QFontInfo(f).family(), chosenFamilyName);
+
+ QFontDatabase::removeApplicationFont(weirdFontId);
+}
+
+void tst_QFont::setFamiliesAndFamily_data()
+{
+ QTest::addColumn<QStringList>("families");
+ QTest::addColumn<QString>("family");
+ QTest::addColumn<QString>("chosenFamilyName");
+
+ const QString weirdFont(QLatin1String("'My, weird'' font name',"));
+ const QString defaultFont(QFont().defaultFamily());
+ if (defaultFont.isEmpty())
+ QSKIP("No default font available on the system");
+
+ const QString timesFont(QLatin1String("Times"));
+ const QString nonExistFont(QLatin1String("NonExistentFont"));
+
+ QTest::newRow("firstInFamilies") << (QStringList() << defaultFont << timesFont) << weirdFont << defaultFont;
+ QTest::newRow("secondInFamilies") << (QStringList() << nonExistFont << weirdFont) << defaultFont << weirdFont;
+ QTest::newRow("family") << (QStringList() << nonExistFont) << defaultFont << defaultFont;
+}
+
+void tst_QFont::setFamiliesAndFamily()
+{
+ QFETCH(QStringList, families);
+ QFETCH(QString, family);
+ QFETCH(QString, chosenFamilyName);
+
+ const int weirdFontId = QFontDatabase::addApplicationFont(":/weirdfont.otf");
+
+ QVERIFY(weirdFontId != -1);
+ QFont f;
+ f.setFamilies(families);
+ f.setFamily(family);
+ QCOMPARE(QFontInfo(f).family(), chosenFamilyName);
+
+ QFontDatabase::removeApplicationFont(weirdFontId);
+}
+
QTEST_MAIN(tst_QFont)
#include "tst_qfont.moc"
diff --git a/tests/auto/gui/text/qfont/weirdfont.otf b/tests/auto/gui/text/qfont/weirdfont.otf
new file mode 100644
index 0000000000..b91c559f5b
--- /dev/null
+++ b/tests/auto/gui/text/qfont/weirdfont.otf
Binary files differ
diff --git a/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp b/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
index fbca313ea3..785cc3fef2 100644
--- a/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
+++ b/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
@@ -45,6 +45,8 @@ public:
private slots:
void engineData_data();
void engineData();
+ void engineDataFamilies_data();
+ void engineDataFamilies();
void clear();
};
@@ -109,6 +111,49 @@ void tst_QFontCache::engineData()
QCOMPARE(engineData, QFontPrivate::get(f)->engineData);
}
+void tst_QFontCache::engineDataFamilies_data()
+{
+ QTest::addColumn<QStringList>("families");
+
+ const QStringList multiple = { QLatin1String("invalid"), QLatin1String("Times New Roman") };
+ const QStringList multipleQuotes = { QLatin1String("'invalid'"), QLatin1String("Times New Roman") };
+ const QStringList multiple2 = { QLatin1String("invalid"), QLatin1String("Times New Roman"),
+ QLatin1String("foobar"), QLatin1String("'baz'") };
+
+ QTest::newRow("unquoted-family-name") << QStringList(QLatin1String("Times New Roman"));
+ QTest::newRow("quoted-family-name") << QStringList(QLatin1String("Times New Roman"));
+ QTest::newRow("invalid") << QStringList(QLatin1String("invalid"));
+ QTest::newRow("multiple") << multiple;
+ QTest::newRow("multiple spaces quotes") << multipleQuotes;
+ QTest::newRow("multiple2") << multiple2;
+}
+
+void tst_QFontCache::engineDataFamilies()
+{
+ QFETCH(QStringList, families);
+
+ QFont f;
+ f.setFamily(QString()); // Unset the family as taken from the QGuiApplication default
+ f.setFamilies(families);
+ f.exactMatch(); // loads engine
+ QFontPrivate *d = QFontPrivate::get(f);
+
+ QFontDef req = d->request;
+ // copy-pasted from QFontDatabase::load(), to engineer the cache key
+ if (req.pixelSize == -1) {
+ req.pixelSize = std::floor(((req.pointSize * d->dpi) / 72) * 100 + 0.5) / 100;
+ req.pixelSize = qRound(req.pixelSize);
+ }
+ if (req.pointSize < 0)
+ req.pointSize = req.pixelSize*72.0/d->dpi;
+
+ req.families = families;
+
+ QFontEngineData *engineData = QFontCache::instance()->findEngineData(req);
+
+ QCOMPARE(engineData, QFontPrivate::get(f)->engineData);
+}
+
void tst_QFontCache::clear()
{
#ifdef QT_BUILD_INTERNAL
diff --git a/tests/auto/gui/text/qglyphrun/BLACKLIST b/tests/auto/gui/text/qglyphrun/BLACKLIST
index 57f32c683d..d8dbdabb4b 100644
--- a/tests/auto/gui/text/qglyphrun/BLACKLIST
+++ b/tests/auto/gui/text/qglyphrun/BLACKLIST
@@ -1,3 +1,4 @@
[mixedScripts]
ubuntu-18.04
b2qt
+windows
diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index b7f014d0e2..1429e4cb7f 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -491,10 +491,6 @@ void tst_QGlyphRun::drawMultiScriptText2()
drawGlyphs.save("drawMultiScriptText2_drawGlyphIndexes.png");
#endif
-#ifdef Q_OS_OSX
- if (drawGlyphs.toImage() != textLayoutDraw.toImage())
- QEXPECT_FAIL("", "See QTBUG-32690", Continue);
-#endif // Q_OS_OSX
QCOMPARE(drawGlyphs, textLayoutDraw);
}
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
index 3f602f5aae..97546c34fd 100644
--- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
@@ -1128,7 +1128,7 @@ void tst_QTextDocument::toHtml_data()
QTextCharFormat fmt;
fmt.setAnchor(true);
- fmt.setAnchorName("blub");
+ fmt.setAnchorNames({"blub"});
cursor.insertText("Blah", fmt);
QTest::newRow("named anchor") << QTextDocumentFragment(&doc)
diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
index d652bb066d..fe0b6dae49 100644
--- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
+++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
@@ -159,6 +159,7 @@ private slots:
void nonZeroMarginOnImport();
void html_charFormatPropertiesUnset();
void html_headings();
+ void html_quotedFontFamily_data();
void html_quotedFontFamily();
void html_spanBackgroundColor();
void defaultFont();
@@ -2206,23 +2207,45 @@ void tst_QTextDocumentFragment::html_headings()
QCOMPARE(doc->blockCount(), 2);
}
-void tst_QTextDocumentFragment::html_quotedFontFamily()
+void tst_QTextDocumentFragment::html_quotedFontFamily_data()
{
- setHtml("<div style=\"font-family: 'Foo Bar';\">Test</div>");
- QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar"));
-
- setHtml("<div style='font-family: \"Foo Bar\";'>Test</div>");
- QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar"));
-
- setHtml("<div style='font-family: \"Foo Bar\";'>Test</div>");
- QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar"));
-
- setHtml("<div style='font-family: Foo\n Bar;'>Test</div>");
- QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar"));
+ QTest::addColumn<QString>("html");
+ QTest::addColumn<QString>("fontFamily");
+ QTest::addColumn<QStringList>("fontFamilies");
+
+ const QString fooFamily = QLatin1String("Foo Bar");
+ const QString weirdFamily = QLatin1String("'Weird, & font '' name',");
+
+ QTest::newRow("data1") << QString("<div style=\"font-family: 'Foo Bar';\">Test</div>")
+ << fooFamily << QStringList(fooFamily);
+ QTest::newRow("data2") << QString("<div style='font-family: \"Foo Bar\";'>Test</div>")
+ << QString("Foo Bar") << QStringList("Foo Bar");
+ QTest::newRow("data3") << QString("<div style='font-family: Foo\n Bar;'>Test</div>")
+ << fooFamily << QStringList(fooFamily);
+ QTest::newRow("data4") << QString("<div style='font-family: Foo\n Bar, serif, \"bar foo\";'>Test"
+ "</div>")
+ << fooFamily << (QStringList() << "Foo Bar" << "serif" << "bar foo");
+ QTest::newRow("data5") << QString("<div style='font-family: \"\\'Weird, & font \\'\\' name\\',"
+ "\";'>Test</div>")
+ << weirdFamily << QStringList(weirdFamily);
+ QTest::newRow("data6") << QString("<div style='font-family: \"\\'Weird, & font \\'\\' name\\',"
+ "\";'>Test</div>")
+ << weirdFamily << QStringList(weirdFamily);
+ QTest::newRow("data7") << QString("<div style='font-family: \"\\'Weird, & font \\'\\' name\\',\", "
+ "serif, \"bar foo\";'>Test</div>")
+ << weirdFamily
+ << (QStringList() << weirdFamily << "serif" << "bar foo");
+}
- setHtml("<div style='font-family: Foo\n Bar, serif, \"bar foo\";'>Test</div>");
- QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar,serif,bar foo"));
+void tst_QTextDocumentFragment::html_quotedFontFamily()
+{
+ QFETCH(QString, html);
+ QFETCH(QString, fontFamily);
+ QFETCH(QStringList, fontFamilies);
+ setHtml(html);
+ QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), fontFamily);
+ QCOMPARE(doc->begin().begin().fragment().charFormat().font().families(), fontFamilies);
}
void tst_QTextDocumentFragment::defaultFont()
diff --git a/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc
index ab882b5db2..8aab86e1ff 100644
--- a/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc
+++ b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc
@@ -3,5 +3,7 @@
<file>texturefiles/car.ktx</file>
<file>texturefiles/pattern.pkm</file>
<file>texturefiles/car_mips.ktx</file>
+ <file>texturefiles/newlogo_srgb.astc</file>
+ <file>texturefiles/newlogo.astc</file>
</qresource>
</RCC>
diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astc b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astc
new file mode 100644
index 0000000000..39bf3f1734
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo.astc
Binary files differ
diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc
new file mode 100644
index 0000000000..38e876829b
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/newlogo_srgb.astc
Binary files differ
diff --git a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
index 9ff4f0ccf2..9b78d18954 100644
--- a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
+++ b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
@@ -49,33 +49,55 @@ void tst_qtexturefilereader::checkHandlers_data()
QTest::addColumn<QList<int>>("dataOffsets");
QTest::addColumn<QList<int>>("dataLengths");
- QTest::addRow("pattern.pkm") << QStringLiteral(":/texturefiles/pattern.pkm")
- << QSize(64, 64)
- << quint32(0x0)
- << quint32(0x8d64)
- << quint32(0x0)
- << 1
- << (QList<int>() << 16)
- << (QList<int>() << 2048);
+ QTest::addRow("pattern.pkm")
+ << QStringLiteral(":/texturefiles/pattern.pkm")
+ << QSize(64, 64)
+ << quint32(0x0)
+ << quint32(0x8d64)
+ << quint32(0x0)
+ << 1
+ << (QList<int>() << 16)
+ << (QList<int>() << 2048);
- QTest::addRow("car.ktx") << QStringLiteral(":/texturefiles/car.ktx")
- << QSize(146, 80)
- << quint32(0x0)
- << quint32(0x9278)
- << quint32(0x1908)
- << 1
- << (QList<int>() << 68)
- << (QList<int>() << 11840);
+ QTest::addRow("car.ktx")
+ << QStringLiteral(":/texturefiles/car.ktx")
+ << QSize(146, 80)
+ << quint32(0x0)
+ << quint32(0x9278)
+ << quint32(0x1908)
+ << 1
+ << (QList<int>() << 68)
+ << (QList<int>() << 11840);
- QTest::addRow("car_mips.ktx") << QStringLiteral(":/texturefiles/car_mips.ktx")
- << QSize(146, 80)
- << quint32(0x0)
- << quint32(0x9274)
- << quint32(0x1907)
- << 8
- << (QList<int>() << 68 << 5992 << 7516 << 7880 << 8004 << 8056 << 8068 << 8080)
- << (QList<int>() << 5920 << 1520 << 360 << 120 << 48 << 8 << 8 << 8);
+ QTest::addRow("car_mips.ktx")
+ << QStringLiteral(":/texturefiles/car_mips.ktx")
+ << QSize(146, 80)
+ << quint32(0x0)
+ << quint32(0x9274)
+ << quint32(0x1907)
+ << 8
+ << (QList<int>() << 68 << 5992 << 7516 << 7880 << 8004 << 8056 << 8068 << 8080)
+ << (QList<int>() << 5920 << 1520 << 360 << 120 << 48 << 8 << 8 << 8);
+ QTest::addRow("newlogo.astc")
+ << QStringLiteral(":/texturefiles/newlogo.astc")
+ << QSize(111, 78)
+ << quint32(0x0)
+ << quint32(0x93b9)
+ << quint32(0x0)
+ << 1
+ << (QList<int>() << 16)
+ << (QList<int>() << 2496);
+
+ QTest::addRow("newlogo_srgb.astc")
+ << QStringLiteral(":/texturefiles/newlogo_srgb.astc")
+ << QSize(111, 78)
+ << quint32(0x0)
+ << quint32(0x93d9)
+ << quint32(0x0)
+ << 1
+ << (QList<int>() << 16)
+ << (QList<int>() << 2496);
}
void tst_qtexturefilereader::checkHandlers()