private slots:
void initTestCase();
+#ifdef Q_OS_WIN
void windowsDefaultLocale();
+#endif
+#ifdef Q_OS_MAC
void macDefaultLocale();
+#endif
void ctor();
void emptyCtor();
QCOMPARE(l.toDateTime(string, QLocale::LongFormat), result);
}
+#ifdef Q_OS_MAC
void tst_QLocale::macDefaultLocale()
{
-#ifndef Q_OS_MAC
- QSKIP("This is a Mac OS X-only test");
-#endif
QLocale locale = QLocale::system();
if (locale.name() != QLatin1String("en_US"))
QCOMPARE(locale.weekdays(), days);
}
+#endif // Q_OS_MAC
#ifdef Q_OS_WIN
#include <qt_windows.h>
#endif // Q_OS_WIN
+#ifdef Q_OS_WIN
void tst_QLocale::windowsDefaultLocale()
{
-#ifdef Q_OS_WIN
RestoreLocaleHelper systemLocale;
// set weird system defaults and make sure we're using them
setWinLocaleInfo(LOCALE_SDECIMAL, QLatin1String("@"));
QCOMPARE(locale.toString(QDateTime(QDate(1974, 12, 1), QTime(1,2,3)), QLocale::LongFormat),
QString("1@12@1974 1^2^3"));
QCOMPARE(locale.toString(QTime(1,2,3), QLocale::LongFormat), QString("1^2^3"));
-#endif // #ifdef Q_OS_WIN
}
+#endif // #ifdef Q_OS_WIN
void tst_QLocale::numberOptions()
{