From 23457bd6d9d54df2cab505e581e72f9942b0fdbb Mon Sep 17 00:00:00 2001 From: John Layt Date: Fri, 27 Jan 2012 20:21:21 +0000 Subject: SIC: QLocale: Make QSystemLocale a private class As discussed on list and approved by Lars and Thiago. Make QSystemLocale private to give us time and space to change it to a better implementation. Change-Id: Ifd806972f3996c43a876f544f78c6557ad71cd75 Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 40 ------------------------ 1 file changed, 40 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 52f01e8754..5544c0fd71 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -123,9 +123,6 @@ private slots: void monthName(); void standaloneMonthName(); - // QSystemLocale tests - void queryDateTime(); - void ampm(); void currency(); void quoteString(); @@ -1778,43 +1775,6 @@ a(QLatin1String("0.0000000000000000000000000000000000000000000000000000000000000 QVERIFY(!ok); } -class SystemLocale : public QSystemLocale -{ -public: - virtual QVariant query(QueryType type, QVariant in) const - { - switch (type) { - case DateTimeFormatLong: return QLatin1String("dddd ddd dd d MMMM MMM MM M yyyy hh:mm:ss.zzz"); - case DateTimeFormatShort: return QLatin1String("d M yy h:m"); - case DateTimeToStringLong: - case DateTimeToStringShort: - return in.toDateTime().toString(type == DateTimeToStringShort - ? QLatin1String("dMyyhm") - : QLatin1String("ddMMyyyyhhmmsszzz")); - default: - break; - } - return QSystemLocale::query(type, in); - } -}; - - - -void tst_QLocale::queryDateTime() -{ - SystemLocale loc; - QCOMPARE(QLocale::system().dateTimeFormat(QLocale::LongFormat), - loc.query(QSystemLocale::DateTimeFormatLong, QVariant()).toString()); - QCOMPARE(QLocale::system().dateTimeFormat(QLocale::ShortFormat), - loc.query(QSystemLocale::DateTimeFormatShort, QVariant()).toString()); - QCOMPARE(QLocale::system().toString(QDateTime(QDate(1974, 12, 1), QTime(1, 2, 3, 4)), QLocale::ShortFormat), - QString("1127412")); - QCOMPARE(QLocale::system().toString(QDateTime(QDate(1974, 12, 1), QTime(1, 2, 3, 4)), QLocale::NarrowFormat), - QLocale::system().toString(QDateTime(QDate(1974, 12, 1), QTime(1, 2, 3, 4)), QLocale::ShortFormat)); - QCOMPARE(QLocale::system().toString(QDateTime(QDate(1974, 12, 1), QTime(1, 2, 3, 4)), QLocale::LongFormat), - QString("01121974010203004")); -} - void tst_QLocale::ampm() { QLocale c(QLocale::C); -- cgit v1.2.3