From 0c2e8bb6e8b192a725f4a83a848aeca0877b10c9 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 4 Jan 2020 00:32:53 +0000 Subject: [PATCH] make use of QLocale::matchingLocales() in QLocale::negativeNumbers() Signed-off-by: Ivailo Monev --- tests/auto/qlocale/tst_qlocale.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/auto/qlocale/tst_qlocale.cpp b/tests/auto/qlocale/tst_qlocale.cpp index 619128bb5..c100765a5 100644 --- a/tests/auto/qlocale/tst_qlocale.cpp +++ b/tests/auto/qlocale/tst_qlocale.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -1181,13 +1180,13 @@ void tst_QLocale::testNames_data() QTest::addColumn("language"); QTest::addColumn("country"); - for (int i = 0; i < localeTblSize; ++i) { - const QLocalePrivate &item = localeTbl[i]; - + int i = 0; + foreach (const QLocale &locale, QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry)) { const QString testName = QString::fromLatin1("data_%1 (%2/%3)").arg(i) - .arg(QLocale::languageToString(item.m_language)) - .arg(QLocale::countryToString(item.m_country)); - QTest::newRow(testName.toLatin1().constData()) << (int)item.m_language << (int)item.m_country; + .arg(QLocale::languageToString(locale.language())) + .arg(QLocale::countryToString(locale.country())); + QTest::newRow(testName.toLatin1().constData()) << (int)locale.language() << (int)locale.country(); + i++; } }