diff options
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/image/qmovie/tst_qmovie.cpp | 12 | ||||
-rw-r--r-- | tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 11 | ||||
-rw-r--r-- | tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp | 28 | ||||
-rw-r--r-- | tests/auto/gui/qvulkan/tst_qvulkan.cpp | 16 | ||||
-rw-r--r-- | tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp | 39 |
5 files changed, 51 insertions, 55 deletions
diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp index 13014e04daa..ba921a66dc0 100644 --- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp +++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp @@ -36,6 +36,7 @@ private slots: void playMovie(); void jumpToFrame_data(); void jumpToFrame(); + void frameDelay(); void changeMovieFile(); #ifndef QT_NO_WIDGETS void infiniteLoop(); @@ -181,6 +182,17 @@ void tst_QMovie::jumpToFrame() QCOMPARE(movie.currentFrameNumber(), 0); } +void tst_QMovie::frameDelay() +{ + QMovie movie(QFINDTESTDATA("animations/comicsecard.gif")); + QList<int> frameDelays{ 200, 800, 800, 2000, 2600 }; + for (int i = 0; i < movie.frameCount(); i++) { + movie.jumpToFrame(i); + // Processing may have taken a little time, so round to nearest 100ms + QCOMPARE(100 * qRound(movie.nextFrameDelay() / 100.0f), frameDelays[i]); + } +} + void tst_QMovie::changeMovieFile() { QMovie movie(QFINDTESTDATA("animations/comicsecard.gif")); diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 92c3ea4a5a7..65812643f5f 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -62,6 +62,7 @@ private slots: #endif void drawPixmapFragments(); void drawPixmapNegativeScale(); + void drawPixmapRounding(); void drawLine_data(); void drawLine(); @@ -747,6 +748,16 @@ void tst_QPainter::drawPixmapNegativeScale() QVERIFY(resultImage.pixel(12, 8) == qRgba(0, 0, 0, 255)); // and right strip is now black } +void tst_QPainter::drawPixmapRounding() +{ + // Just test that we don't assert + QBitmap bm(8, 8); + QImage out(64, 64, QImage::Format_RGB32); + QPainter p(&out); + qreal y = 26.499999999999996; + p.drawPixmap(QPointF(0, y), bm); +} + void tst_QPainter::drawLine_data() { QTest::addColumn<QLine>("line"); diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index 20ee6e07c78..cb03d6cf469 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -81,6 +81,8 @@ private slots: void intersectionEquality(); void intersectionPointOnEdge(); + + void boundsAtStartPoint(); }; void tst_QPainterPath::cleanupTestCase() @@ -1442,6 +1444,32 @@ void tst_QPainterPath::intersectionPointOnEdge() QVERIFY(p.intersects(r)); } +void tst_QPainterPath::boundsAtStartPoint() +{ + const QPointF startPoint(10, 10); + const QPainterPath constructedPath(startPoint); + { + const auto boundingRect = constructedPath.boundingRect(); + const auto topLeft = boundingRect.topLeft(); + QCOMPARE(topLeft, startPoint); + QCOMPARE(topLeft, constructedPath.elementAt(0)); + QCOMPARE(boundingRect, constructedPath.controlPointRect()); + } + + QPainterPath defaultPath; + defaultPath.moveTo(startPoint); + { + const auto boundingRect = defaultPath.boundingRect(); + const auto topLeft = boundingRect.topLeft(); + QCOMPARE(topLeft, startPoint); + QCOMPARE(topLeft, defaultPath.elementAt(0)); + QCOMPARE(boundingRect, defaultPath.controlPointRect()); + } + + QCOMPARE(constructedPath.boundingRect(), defaultPath.boundingRect()); + QCOMPARE(constructedPath.controlPointRect(), defaultPath.controlPointRect()); +} + QTEST_APPLESS_MAIN(tst_QPainterPath) #include "tst_qpainterpath.moc" diff --git a/tests/auto/gui/qvulkan/tst_qvulkan.cpp b/tests/auto/gui/qvulkan/tst_qvulkan.cpp index 0afebfba28f..1be39f77a7d 100644 --- a/tests/auto/gui/qvulkan/tst_qvulkan.cpp +++ b/tests/auto/gui/qvulkan/tst_qvulkan.cpp @@ -27,10 +27,6 @@ private slots: void tst_QVulkan::vulkanInstance() { -#ifdef Q_OS_ANDROID - if (QNativeInterface::QAndroidApplication::sdkVersion() >= 31) - QSKIP("Fails on Android 12 (QTBUG-111236)"); -#endif QVulkanInstance inst; if (!inst.create()) QSKIP("Vulkan init failed; skip"); @@ -67,10 +63,6 @@ void tst_QVulkan::vulkanInstance() void tst_QVulkan::vulkanCheckSupported() { -#ifdef Q_OS_ANDROID - if (QNativeInterface::QAndroidApplication::sdkVersion() >= 31) - QSKIP("Fails on Android 12 (QTBUG-111236)"); -#endif // Test the early calls to supportedLayers/extensions/apiVersion that need // the library and some basics, but do not initialize the instance. QVulkanInstance inst; @@ -214,10 +206,6 @@ void tst_QVulkan::vulkanPlainWindow() void tst_QVulkan::vulkanVersionRequest() { -#ifdef Q_OS_ANDROID - if (QNativeInterface::QAndroidApplication::sdkVersion() >= 31) - QSKIP("Fails on Android 12 (QTBUG-111236)"); -#endif QVulkanInstance inst; if (!inst.create()) QSKIP("Vulkan init failed; skip"); @@ -264,10 +252,6 @@ static void waitForUnexposed(QWindow *w) void tst_QVulkan::vulkanWindow() { -#ifdef Q_OS_ANDROID - if (QNativeInterface::QAndroidApplication::sdkVersion() >= 31) - QSKIP("Fails on Android 12 (QTBUG-111236)"); -#endif QVulkanInstance inst; if (!inst.create()) QSKIP("Vulkan init failed; skip"); diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index 43cb6667ec5..d729cfbf6ee 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -56,9 +56,6 @@ private slots: void shapingDisabledDevanagari(); void shapingDisabledLatin(); - - void privateUseArea(); - private: bool haveTestFonts; }; @@ -1316,41 +1313,5 @@ void tst_QTextScriptEngine::shapingDisabledDevanagari() QCOMPARE(noShapingRuns.first().glyphIndexes().size(), normalRuns.first().glyphIndexes().size()); } -void tst_QTextScriptEngine::privateUseArea() -{ - QString privateUseAreaString = QString::fromUtf8(""); - - QFont font; - QList<QGlyphRun> withFontMerging; - { - QTextLayout layout; - layout.setText(privateUseAreaString); - layout.setFont(font); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - withFontMerging = layout.glyphRuns(); - } - - font.setStyleStrategy(QFont::NoFontMerging); - QList<QGlyphRun> withoutFontMerging; - { - QTextLayout layout; - layout.setText(privateUseAreaString); - layout.setFont(font); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - withoutFontMerging = layout.glyphRuns(); - } - - QCOMPARE(withFontMerging.size(), withoutFontMerging.size()); - - for (int i = 0; i < withFontMerging.size(); ++i) - QCOMPARE(withFontMerging.at(i).glyphIndexes(), withoutFontMerging.at(i).glyphIndexes()); -} - QTEST_MAIN(tst_QTextScriptEngine) #include "tst_qtextscriptengine.moc" |