diff options
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/rhi/qrhi/tst_qrhi.cpp | 50 | ||||
-rw-r--r-- | tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp | 21 |
2 files changed, 21 insertions, 50 deletions
diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp index 6f88b7fab5..191260fd41 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -381,56 +381,6 @@ void tst_QRhi::nativeHandles() } } - // QRhiTexture::nativeHandles() - { - QScopedPointer<QRhiTexture> tex(rhi->newTexture(QRhiTexture::RGBA8, QSize(512, 256))); - QVERIFY(tex->build()); - - const QRhiNativeHandles *texHandles = tex->nativeHandles(); - QVERIFY(texHandles); - - switch (impl) { - case QRhi::Null: - break; -#ifdef TST_VK - case QRhi::Vulkan: - { - const QRhiVulkanTextureNativeHandles *vkHandles = static_cast<const QRhiVulkanTextureNativeHandles *>(texHandles); - QVERIFY(vkHandles->image); - QVERIFY(vkHandles->layout >= 1); // VK_IMAGE_LAYOUT_GENERAL - QVERIFY(vkHandles->layout <= 8); // VK_IMAGE_LAYOUT_PREINITIALIZED - } - break; -#endif -#ifdef TST_GL - case QRhi::OpenGLES2: - { - const QRhiGles2TextureNativeHandles *glHandles = static_cast<const QRhiGles2TextureNativeHandles *>(texHandles); - QVERIFY(glHandles->texture); - } - break; -#endif -#ifdef TST_D3D11 - case QRhi::D3D11: - { - const QRhiD3D11TextureNativeHandles *d3dHandles = static_cast<const QRhiD3D11TextureNativeHandles *>(texHandles); - QVERIFY(d3dHandles->texture); - } - break; -#endif -#ifdef TST_MTL - case QRhi::Metal: - { - const QRhiMetalTextureNativeHandles *mtlHandles = static_cast<const QRhiMetalTextureNativeHandles *>(texHandles); - QVERIFY(mtlHandles->texture); - } - break; -#endif - default: - Q_ASSERT(false); - } - } - // QRhiCommandBuffer::nativeHandles() { QRhiCommandBuffer *cb = nullptr; diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index 3917c859cc..6eae6db12a 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -194,6 +194,8 @@ private slots: void fontTagFace(); void clearUndoRedoStacks(); + void mergeFontFamilies(); + private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); void buildRegExpData(); @@ -3585,6 +3587,25 @@ void tst_QTextDocument::fontTagFace() } } +void tst_QTextDocument::mergeFontFamilies() +{ + QTextDocument td; + td.setHtml(QLatin1String( + "<html><body>" + "<span style=\" font-family:'MS Shell Dlg 2';\">Hello world</span>" + "</body></html>")); + + QTextCharFormat newFormat; + newFormat.setFontFamily(QLatin1String("Jokerman")); + + QTextCursor cursor = QTextCursor(&td); + cursor.setPosition(0); + cursor.setPosition(QByteArray("Hello World").length(), QTextCursor::KeepAnchor); + cursor.mergeCharFormat(newFormat); + + QVERIFY(td.toHtml().contains(QLatin1String("font-family:'Jokerman','MS Shell Dlg 2';"))); +} + void tst_QTextDocument::clearUndoRedoStacks() { QTextDocument doc; |