summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2014-08-26 12:36:02 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2014-08-26 12:36:02 (GMT)
commitdf03c4ff0065bd982b2b21e08b5ba200b0aa9066 (patch)
tree4c2185e68e99f20555d0af4bfd128f87a059718b
parent6606618f20a6189bfff15d04f61321d68ff39fc9 (diff)
downloadlibkolabxml-df03c4ff0065bd982b2b21e08b5ba200b0aa9066.tar.gz
Ensure we can convert date-only birthdays and anniversaries.
-rw-r--r--tests/bindingstest.cpp17
-rw-r--r--tests/bindingstest.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/bindingstest.cpp b/tests/bindingstest.cpp
index 6549319..8dd2bd5 100644
--- a/tests/bindingstest.cpp
+++ b/tests/bindingstest.cpp
@@ -743,6 +743,23 @@ void BindingsTest::contactCompletness()
QCOMPARE(e.customProperties(), c.customProperties());
}
+void BindingsTest::dateOnlyDates()
+{
+ Kolab::Contact c;
+ c.setUid("1045b57d-ff7f-0000-d814-867b4d7f0000");
+ c.setName("name");
+ c.setBDay(Kolab::cDateTime(2001,12,10));
+ c.setAnniversary(Kolab::cDateTime(2001,3,2));
+
+ const std::string result = Kolab::writeContact(c);
+ QVERIFY(Kolab::error() == Kolab::NoError);
+// std::cout << result << endl;
+ Kolab::Contact e = Kolab::readContact(result, false);
+ QVERIFY(Kolab::error() == Kolab::NoError);
+ QCOMPARE(e.bDay(), c.bDay());
+ QCOMPARE(e.anniversary(), c.anniversary());
+}
+
void BindingsTest::distlistCompletness()
{
std::vector<std::string> stringlist;
diff --git a/tests/bindingstest.h b/tests/bindingstest.h
index 5d04e11..b2dfd43 100644
--- a/tests/bindingstest.h
+++ b/tests/bindingstest.h
@@ -37,6 +37,7 @@ class BindingsTest : public QObject
void freebusyCompletness();
void contactCompletness();
+ void dateOnlyDates();
void distlistCompletness();
void generateTimestampIfEmpty();