From 1268a64bdd1320639cad0d9c8331fb6fd682b30c Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Fri, 3 Aug 2012 16:00:00 +0200 Subject: add stub for addresses --- tests/vcard.cpp | 20 ++++++++++++++++++++ tests/vcard.h | 2 ++ 2 files changed, 22 insertions(+) (limited to 'tests') diff --git a/tests/vcard.cpp b/tests/vcard.cpp index b92b269b..ccc65199 100644 --- a/tests/vcard.cpp +++ b/tests/vcard.cpp @@ -26,6 +26,26 @@ #include "tests.h" #include "vcard.h" +void tst_QXmppVCardIq::testAddress_data() +{ + QTest::addColumn("xml"); + QTest::addColumn("type"); + + QTest::newRow("none") << QByteArray("") << int(QXmppVCardAddress::None); + QTest::newRow("HOME") << QByteArray("") << int(QXmppVCardAddress::Home); +} + +void tst_QXmppVCardIq::testAddress() +{ + QFETCH(QByteArray, xml); + QFETCH(int, type); + + QXmppVCardAddress address; + parsePacket(address, xml); + QCOMPARE(int(address.type()), type); + serializePacket(address, xml); +} + void tst_QXmppVCardIq::testEmail_data() { QTest::addColumn("xml"); diff --git a/tests/vcard.h b/tests/vcard.h index cc1527c1..29a1dcad 100644 --- a/tests/vcard.h +++ b/tests/vcard.h @@ -28,6 +28,8 @@ class tst_QXmppVCardIq : public QObject Q_OBJECT private slots: + void testAddress_data(); + void testAddress(); void testEmail_data(); void testEmail(); void testPhone_data(); -- cgit v1.2.3