diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-07-22 01:30:51 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-07-22 01:30:51 +0200 |
| commit | b51d173c0a946d9660f2d0ceb9673915d9a60300 (patch) | |
| tree | e4293784d534ac3959524134ea179177a987f64d /tests/roster.cpp | |
| parent | a50967ee0123eee75711b7f336e453654f2e06af (diff) | |
| download | qxmpp-b51d173c0a946d9660f2d0ceb9673915d9a60300.tar.gz | |
test name
Diffstat (limited to 'tests/roster.cpp')
| -rw-r--r-- | tests/roster.cpp | 15 |
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); |
