void dateTimeFormat();
void timeFormat_data();
void timeFormat();
+#if defined(Q_OS_UNIX)
void timeZoneUpdated();
+#endif
void dateToLocaleString_data();
void dateToLocaleString();
QCOMPARE(obj->property("comparison").toInt(), QString::localeAwareCompare(string1, string2));
}
-static void setTimeZone(const QByteArray &tz)
-{
- qputenv("TZ", tz);
-#if defined(Q_OS_WIN32)
- ::_tzset();
-#elif defined(Q_OS_UNIX)
- ::tzset();
-#endif
-}
-
class DateFormatter : public QObject
{
Q_OBJECT
return locale.toString(input);
}
-void tst_qqmllocale::timeZoneUpdated()
+#if defined(Q_OS_UNIX)
+// Currently disabled on Windows as adjusting the timezone
+// requires additional privileges that aren't normally
+// enabled for a process. This can be achieved by calling
+// AdjustTokenPrivileges() and then SetTimeZoneInformation(),
+// which will require linking to a different library to access that API.
+static void setTimeZone(const QByteArray &tz)
{
-#if !defined(Q_OS_UNIX)
- // Currently disabled on Windows as adjusting the timezone
- // requires additional privileges that aren't normally
- // enabled for a process. This can be achieved by calling
- // AdjustTokenPrivileges() and then SetTimeZoneInformation(),
- // which will require linking to a different library to access that API.
- QSKIP("Timezone manipulation not available for this platform");
-#endif
+ qputenv("TZ", tz);
+ ::tzset();
+// following left for future reference, see comment above
+// #if defined(Q_OS_WIN32)
+// ::_tzset();
+// #endif
+}
+
+void tst_qqmllocale::timeZoneUpdated()
+{
QByteArray original(qgetenv("TZ"));
// Set the timezone to Brisbane time
QCOMPARE(obj->property("success").toBool(), true);
}
+#endif
QTEST_MAIN(tst_qqmllocale)