From e9b79c0c74405ab193003c62c6b8a8538471b5b4 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 23 May 2024 15:24:38 +0200 Subject: [PATCH] tst_QTZ::localeSpecificDisplayName(): expect failure when data lacking QTZ::displayName() returns an empty string if it doesn't know how to localize a zone name. In this case, we can't expect it to match the expected name, which depends on having relevant locale data available. Task-number: QTBUG-115158 Change-Id: I1cd8c1469399502764c354bf24423298f106f23e Reviewed-by: Ivan Solovev --- tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp index 7f6bc96aa6d..c746dbc2d99 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -1685,6 +1685,8 @@ void tst_QTimeZone::localeSpecificDisplayName() QVERIFY(zone.isValid()); const QString localeName = zone.displayName(timeType, QTimeZone::LongName, locale); + if (localeName.isEmpty()) // Backend doesn't know how to localize this zone's name + QEXPECT_FAIL("", "QTBUG-115158 zone name localization unknown", Continue); QCOMPARE(localeName, expectedName); }