summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-13 08:20:02 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-13 08:20:02 (GMT)
commit14bb52d5e22c02d92b1c6a09050eacd2185c934a (patch)
treee00cfea6b1de5e4093d5e107e394f61a0509cda5
parent72e2ed7189114f559a6b690c928cf4a893a0c802 (diff)
Start to look at parsing vcard2.1v16.11.80
-rw-r--r--autotests/phonenumbertest.cpp20
-rw-r--r--autotests/phonenumbertest.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/autotests/phonenumbertest.cpp b/autotests/phonenumbertest.cpp
index facff95..93ace9f 100644
--- a/autotests/phonenumbertest.cpp
+++ b/autotests/phonenumbertest.cpp
@@ -183,6 +183,26 @@ void PhoneNumberTest::labelTest()
QLatin1String("Work Fax/Preferred"));
}
+void PhoneNumberTest::shouldParseVCard21()
+{
+ QByteArray vcarddata("BEGIN:VCARD\n"
+ "VERSION:2.1\n"
+ "EMAIL:foo@kde.org\n"
+ "N:;;;;\n"
+ "TEL;CELL;WORK:+1-919-676-9564\n"
+ "UID:testuid\n"
+ "END:VCARD\n"
+ "\n");
+
+ KContacts::VCardTool vcard;
+ const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
+ QCOMPARE(lst.count(), 1);
+ KContacts::Addressee addr = lst.at(0);
+ QCOMPARE(addr.phoneNumbers().count(), 1);
+ KContacts::PhoneNumber number1 = addr.phoneNumbers().at(0);
+ //QCOMPARE(number1.number(), QString());
+}
+
void PhoneNumberTest::shouldExportVCard21()
{
KContacts::AddresseeList lst;
diff --git a/autotests/phonenumbertest.h b/autotests/phonenumbertest.h
index 31a2c88..3eb9a94 100644
--- a/autotests/phonenumbertest.h
+++ b/autotests/phonenumbertest.h
@@ -42,6 +42,7 @@ private Q_SLOTS:
void shouldParseVcard4();
void shouldExportVCard21();
+ void shouldParseVCard21();
};
#endif