aboutsummaryrefslogtreecommitdiff
path: root/tests/roster.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-07-22 01:30:51 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-07-22 01:30:51 +0200
commitb51d173c0a946d9660f2d0ceb9673915d9a60300 (patch)
treee4293784d534ac3959524134ea179177a987f64d /tests/roster.cpp
parenta50967ee0123eee75711b7f336e453654f2e06af (diff)
downloadqxmpp-b51d173c0a946d9660f2d0ceb9673915d9a60300.tar.gz
test name
Diffstat (limited to 'tests/roster.cpp')
-rw-r--r--tests/roster.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/roster.cpp b/tests/roster.cpp
index 07e926e7..718dbbb8 100644
--- a/tests/roster.cpp
+++ b/tests/roster.cpp
@@ -29,38 +29,51 @@
void tst_QXmppRosterIq::testItem_data()
{
QTest::addColumn<QByteArray>("xml");
+ QTest::addColumn<QString>("name");
QTest::addColumn<int>("subscriptionType");
QTest::newRow("none")
<< QByteArray("<item jid=\"foo@example.com\" subscription=\"none\"/>")
+ << ""
<< int(QXmppRosterIq::Item::None);
QTest::newRow("from")
<< QByteArray("<item jid=\"foo@example.com\" subscription=\"from\"/>")
+ << ""
<< int(QXmppRosterIq::Item::From);
QTest::newRow("to")
<< QByteArray("<item jid=\"foo@example.com\" subscription=\"to\"/>")
+ << ""
<< int(QXmppRosterIq::Item::To);
QTest::newRow("both")
<< QByteArray("<item jid=\"foo@example.com\" subscription=\"both\"/>")
+ << ""
<< int(QXmppRosterIq::Item::Both);
QTest::newRow("remove")
<< QByteArray("<item jid=\"foo@example.com\" subscription=\"remove\"/>")
+ << ""
<< int(QXmppRosterIq::Item::Remove);
QTest::newRow("notset")
<< QByteArray("<item jid=\"foo@example.com\"/>")
+ << ""
+ << int(QXmppRosterIq::Item::NotSet);
+
+ QTest::newRow("name")
+ << QByteArray("<item jid=\"foo@example.com\" name=\"foo bar\"/>")
+ << "foo bar"
<< int(QXmppRosterIq::Item::NotSet);
}
void tst_QXmppRosterIq::testItem()
{
QFETCH(QByteArray, xml);
+ QFETCH(QString, name);
QFETCH(int, subscriptionType);
QXmppRosterIq::Item item;
parsePacket(item, xml);
QCOMPARE(item.bareJid(), QLatin1String("foo@example.com"));
QCOMPARE(item.groups(), QSet<QString>());
- QCOMPARE(item.name(), QString());
+ QCOMPARE(item.name(), name);
QCOMPARE(int(item.subscriptionType()), subscriptionType);
QCOMPARE(item.subscriptionStatus(), QString());
serializePacket(item, xml);