From 2c4874be40aa40b698315cac0ad768e5c650a740 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 20 Oct 2020 11:41:13 +0200 Subject: Deprecate old aliases for two countries and several languages [ChangeLog][QtCore][QLocale] Deprecated several Language and Country aliases, ready for removal in Qt 6.0, in favor of their newer names. Task-number: QTBUG-84669 Pick-to: 5.15 5.15.2 Change-Id: Iebaa0a5a77bfa12f7014de53fab4a25b5f1cc92c Reviewed-by: Lars Knoll --- tests/auto/corelib/text/qcollator/tst_qcollator.cpp | 4 ++-- tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/auto/corelib') diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp index e0c5cea980..46608e8d7f 100644 --- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp @@ -233,12 +233,12 @@ void tst_QCollator::state() c.setLocale(QLocale::French); c.setNumericMode(true); c.setIgnorePunctuation(true); - c.setLocale(QLocale::Norwegian); + c.setLocale(QLocale::NorwegianBokmal); QCOMPARE(c.caseSensitivity(), Qt::CaseInsensitive); QCOMPARE(c.numericMode(), true); QCOMPARE(c.ignorePunctuation(), true); - QCOMPARE(c.locale(), QLocale(QLocale::Norwegian)); + QCOMPARE(c.locale(), QLocale(QLocale::NorwegianBokmal)); } diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 87e526cba3..8d0d53e8f0 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -454,12 +454,11 @@ void tst_QLocale::defaulted_ctor() TEST_CTOR("eo", Esperanto, World) TEST_CTOR("yi", Yiddish, World) - QVERIFY(QLocale::Norwegian == QLocale::NorwegianBokmal); - TEST_CTOR("no", Norwegian, Norway) - TEST_CTOR("nb", Norwegian, Norway) + TEST_CTOR("no", NorwegianBokmal, Norway) + TEST_CTOR("nb", NorwegianBokmal, Norway) TEST_CTOR("nn", NorwegianNynorsk, Norway) - TEST_CTOR("no_NO", Norwegian, Norway) - TEST_CTOR("nb_NO", Norwegian, Norway) + TEST_CTOR("no_NO", NorwegianBokmal, Norway) + TEST_CTOR("nb_NO", NorwegianBokmal, Norway) TEST_CTOR("nn_NO", NorwegianNynorsk, Norway) TEST_CTOR("es_ES", Spanish, Spain) TEST_CTOR("es_419", Spanish, LatinAmerica) @@ -645,9 +644,9 @@ void tst_QLocale::emptyCtor() void tst_QLocale::legacyNames() { - QVERIFY(QLocale::Norwegian == QLocale::NorwegianBokmal); QLocale::setDefault(QLocale(QLocale::C)); +#if QT_DEPRECATED_SINCE(5, 15) #define TEST_CTOR(req_lang, req_country, exp_lang, exp_country) \ { \ QLocale l(QLocale::req_lang, QLocale::req_country); \ @@ -661,6 +660,7 @@ void tst_QLocale::legacyNames() TEST_CTOR(Tagalog, AnyCountry, Filipino, Philippines) #undef TEST_CTOR +#endif #define TEST_CTOR(req_lc, exp_lang, exp_country) \ { \ @@ -674,7 +674,7 @@ void tst_QLocale::legacyNames() } TEST_CTOR("mo_MD", Romanian, Moldova) - TEST_CTOR("no", Norwegian, Norway) + TEST_CTOR("no", NorwegianBokmal, Norway) TEST_CTOR("sh_ME", Serbian, Montenegro) TEST_CTOR("tl", Filipino, Philippines) TEST_CTOR("iw", Hebrew, Israel) -- cgit v1.2.3