summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-11-13 13:07:38 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-11-13 13:07:38 (GMT)
commitcd2e03138691d4e7a7e08b12f438f4a80cc7c513 (patch)
tree9af82610d70b676cdc0c37a48d88d974680addb3 /tests
parent7b064eb52225198dbc3c41aa88b9010bb24d5ebc (diff)
downloadlibkolab-cd2e03138691d4e7a7e08b12f438f4a80cc7c513.tar.gz
Convert utc offset date times to utc.
Diffstat (limited to 'tests')
-rw-r--r--tests/timezonetest.cpp8
-rw-r--r--tests/timezonetest.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/timezonetest.cpp b/tests/timezonetest.cpp
index d2c49b7..d382425 100644
--- a/tests/timezonetest.cpp
+++ b/tests/timezonetest.cpp
@@ -17,6 +17,7 @@
#include "timezonetest.h"
#include <conversion/timezoneconverter.h>
+#include <conversion/commonconversion.h>
#include <kolabformat/kolabobject.h>
#include <kolabformat/errorhandler.h>
#include "testutils.h"
@@ -168,6 +169,13 @@ void TimezoneTest::testTimezoneDaemonAvailable()
QVERIFY(KSystemTimeZones::isTimeZoneDaemonAvailable());
}
+void TimezoneTest::testUTCOffset()
+{
+ const Kolab::cDateTime expected(2013, 10, 23, 2, 0 ,0, true);
+ const KDateTime input(KDateTime::fromString("2013-10-23T04:00:00+02:00", KDateTime::RFC3339Date));
+ const Kolab::cDateTime result = Kolab::Conversion::fromDate(input);
+ QCOMPARE(result, expected);
+}
QTEST_MAIN( TimezoneTest )
diff --git a/tests/timezonetest.h b/tests/timezonetest.h
index ed2f33f..fa518a6 100644
--- a/tests/timezonetest.h
+++ b/tests/timezonetest.h
@@ -35,6 +35,7 @@ private slots:
void testKolabObjectReader();
void testFindLegacyTimezone();
void testTimezoneDaemonAvailable();
+ void testUTCOffset();
};
#endif // TIMEZONETEST_H