From a50967ee0123eee75711b7f336e453654f2e06af Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Sun, 22 Jul 2012 01:28:11 +0200 Subject: extend test coverage --- tests/roster.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'tests/roster.cpp') diff --git a/tests/roster.cpp b/tests/roster.cpp index 96f0fe49..07e926e7 100644 --- a/tests/roster.cpp +++ b/tests/roster.cpp @@ -31,18 +31,24 @@ void tst_QXmppRosterIq::testItem_data() QTest::addColumn("xml"); QTest::addColumn("subscriptionType"); - QTest::newRow("notset") - << QByteArray("") - << int(QXmppRosterIq::Item::NotSet); + QTest::newRow("none") + << QByteArray("") + << int(QXmppRosterIq::Item::None); QTest::newRow("from") - << QByteArray("") + << QByteArray("") << int(QXmppRosterIq::Item::From); QTest::newRow("to") - << QByteArray("") + << QByteArray("") << int(QXmppRosterIq::Item::To); QTest::newRow("both") - << QByteArray("") + << QByteArray("") << int(QXmppRosterIq::Item::Both); + QTest::newRow("remove") + << QByteArray("") + << int(QXmppRosterIq::Item::Remove); + QTest::newRow("notset") + << QByteArray("") + << int(QXmppRosterIq::Item::NotSet); } void tst_QXmppRosterIq::testItem() @@ -52,7 +58,11 @@ void tst_QXmppRosterIq::testItem() QXmppRosterIq::Item item; parsePacket(item, xml); + QCOMPARE(item.bareJid(), QLatin1String("foo@example.com")); + QCOMPARE(item.groups(), QSet()); + QCOMPARE(item.name(), QString()); QCOMPARE(int(item.subscriptionType()), subscriptionType); + QCOMPARE(item.subscriptionStatus(), QString()); serializePacket(item, xml); } -- cgit v1.2.3