diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-05-04 10:46:17 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-05-05 16:28:53 +0200 |
commit | 358df462a03f658277d6ce79d7846d3d53d8d05e (patch) | |
tree | 35897d96990ac4d90ae0eb2a9825ae573f10768c /tests | |
parent | 3b155973c494e847b821f0b5675a061f4e424a6c (diff) |
Fix assertion on matchingLocales(Abhkazian, Any, Any)
CLDR v39 has no locales for Abkhazian, so the locale_index[] entry for
it actually indexes the last entry before the next language up the
enum. This has m_language_id less than Abkhazian.
Change-Id: If8b88f30476a981b3ee00ff8760a46ede0b7aab7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 56eef7ac99..785bfdef44 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -716,6 +716,12 @@ void tst_QLocale::matchingLocales() QVERIFY(!locales.isEmpty()); QVERIFY(!locales.contains(c)); QVERIFY(locales.contains(ru_RU)); + + // Regression check for assertion failure when no locales match: + locales = QLocale::matchingLocales(QLocale::Abkhazian, QLocale::AnyScript, QLocale::AnyTerritory); + // Empty in CLDR v39, but don't require that. + QVERIFY(!locales.contains(c)); + QVERIFY(!locales.contains(ru_RU)); } void tst_QLocale::unixLocaleName_data() |