From 87f0096c80d3bdc49bbc741f26ee5aec83d58ce4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 10 Nov 2021 08:32:01 +0100 Subject: [PATCH] Fix tst_qfontdatabase on Windows with Freetype Since e05e3c776256d35798f451f31cd71e809786ed78, the advance test in tst_QFontDatabase::condensedFontMatching() passes with the bundled freetype engine, so the XFAIL causes a failure when running with this configuration. Change-Id: Ie6fbccfa0d9c79654563e9e3f19694f252e32fc6 Reviewed-by: Allan Sandfeld Jensen (cherry picked from commit 518790af79df339143820cd9d34a74c00db1ed7e) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp index 1fefec31294..e0cda4d5f41 100644 --- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include Q_LOGGING_CATEGORY(lcTests, "qt.text.tests") @@ -405,7 +407,9 @@ void tst_QFontDatabase::condensedFontMatching() tfcByStyleName.setStyleName("Condensed"); #ifdef Q_OS_WIN - QEXPECT_FAIL("","No matching of sub-family by stretch on Windows", Continue); + QFontPrivate *font_d = QFontPrivate::get(tfcByStretch); + if (font_d->engineForScript(QChar::Script_Common)->type() != QFontEngine::Freetype) + QEXPECT_FAIL("","No matching of sub-family by stretch on Windows", Continue); #endif #ifdef Q_OS_ANDROID