diff options
Diffstat (limited to 'tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp')
-rw-r--r-- | tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp b/tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp index 1194cf0895..44c6ce3aa6 100644 --- a/tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp +++ b/tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp @@ -1,15 +1,21 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QLocale> +#include <QCalendar> #include <QCoreApplication> #include <QTextStream> int main(int argc, char** argv) { QCoreApplication app(argc, argv); - QLocale l; + // Setting a default locale should not mess up the system one. + QLocale::setDefault(QLocale::Persian); + QLocale l = QLocale::system(); + // A non-Roman calendar will use CLDR data instead of system data, so needs + // to have got the right locale index to look that up. + QCalendar cal = QCalendar(QCalendar::System::Jalali); QTextStream str(stdout); - str << l.name(); + str << l.name() << ' ' << cal.standaloneMonthName(l, 2); return 0; } |