aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-28 15:40:20 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-28 15:40:20 (GMT)
commit47a93967380e6b9167952b0b12e29d5538da1f9b (patch)
tree76c29832527d024c857142642c3f7b950083346c
parent798fae88b1764575eab50c36759f7e59348bc66f (diff)
Test parsing birthday without year
-rw-r--r--autotests/birthdaytest.cpp19
-rw-r--r--autotests/birthdaytest.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/autotests/birthdaytest.cpp b/autotests/birthdaytest.cpp
index 6e02b57..cd1a8b4 100644
--- a/autotests/birthdaytest.cpp
+++ b/autotests/birthdaytest.cpp
@@ -73,6 +73,25 @@ void BirthDayTest::shouldParseBirthDayWithoutTime()
QCOMPARE(lst.at(0).birthdayHasTime(), false);
}
+void BirthDayTest::shouldParseBirthDayWithoutTimeAndYear()
+{
+ QByteArray vcarddata("BEGIN:VCARD\r\n"
+ "VERSION:4.0\r\n"
+ "BDAY:--0505\r\n"
+ "EMAIL:foo@kde.org\r\n"
+ "EMAIL:bla@kde.org\r\n"
+ "N:;;;;\r\n"
+ "UID:testuid\r\n"
+ "END:VCARD\r\n\r\n");
+
+ KContacts::VCardTool vcard;
+ const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
+ QCOMPARE(lst.count(), 1);
+ QDateTime dt(QDate(-1, 5, 5));
+ QCOMPARE(lst.at(0).birthday(), dt);
+ QCOMPARE(lst.at(0).birthdayHasTime(), false);
+}
+
void BirthDayTest::shouldExportVcard4()
{
KContacts::AddresseeList lst;
diff --git a/autotests/birthdaytest.h b/autotests/birthdaytest.h
index ef5e97f..cb7626c 100644
--- a/autotests/birthdaytest.h
+++ b/autotests/birthdaytest.h
@@ -37,6 +37,7 @@ private Q_SLOTS:
void shouldExportVcard3WithoutTime();
void shouldParseBirthDay();
void shouldParseBirthDayWithoutTime();
+ void shouldParseBirthDayWithoutTimeAndYear();
};
#endif // BIRTHDAYTEST_H