From aefa4f51b84542c1203930323da74d603a8d9345 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Sat, 21 Jul 2012 16:04:36 +0200 Subject: use new QXmppPresence constants --- tests/presence.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'tests/presence.cpp') diff --git a/tests/presence.cpp b/tests/presence.cpp index c693b0ac..ce7168a6 100644 --- a/tests/presence.cpp +++ b/tests/presence.cpp @@ -37,30 +37,30 @@ void tst_QXmppPresence::testPresence_data() QTest::addColumn("vcardUpdate"); QTest::addColumn("photoHash"); - QTest::newRow("empty") << QByteArray("") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); - QTest::newRow("unavailable") << QByteArray("") << int(QXmppPresence::Unavailable) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); - QTest::newRow("error") << QByteArray("") << int(QXmppPresence::Error) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("empty") << QByteArray("") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("unavailable") << QByteArray("") << int(QXmppPresence::Unavailable) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("error") << QByteArray("") << int(QXmppPresence::Error) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); - QTest::newRow("full") << QByteArray("awayIn a meeting5") << int(QXmppPresence::Available) << 5 << int(QXmppPresence::Status::Away) << "In a meeting" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("full") << QByteArray("awayIn a meeting5") << int(QXmppPresence::Available) << 5 << int(QXmppPresence::Away) << "In a meeting" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); // status type - QTest::newRow("away") << QByteArray("away") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Away) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); - QTest::newRow("dnd") << QByteArray("dnd") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::DND) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); - QTest::newRow("chat") << QByteArray("chat") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Chat) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); - QTest::newRow("xa") << QByteArray("xa") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::XA) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); - QTest::newRow("invisible") << QByteArray("invisible") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Invisible) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("away") << QByteArray("away") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Away) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("dnd") << QByteArray("dnd") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::DND) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("chat") << QByteArray("chat") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Chat) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("xa") << QByteArray("xa") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::XA) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); + QTest::newRow("invisible") << QByteArray("invisible") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Invisible) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray(); QTest::newRow("vcard-photo") << QByteArray( "" "" "73b908bc" "" - "") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateValidPhoto) << QByteArray::fromHex("73b908bc"); + "") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateValidPhoto) << QByteArray::fromHex("73b908bc"); QTest::newRow("vard-not-ready") << QByteArray( "" "" - "") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateNotReady) << QByteArray(); + "") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateNotReady) << QByteArray(); } void tst_QXmppPresence::testPresence() @@ -107,9 +107,9 @@ void tst_QXmppPresence::testPresenceWithCapability() parsePacket(presence, xml); QCOMPARE(presence.to(), QString("foo@example.com/QXmpp")); QCOMPARE(presence.from(), QString("bar@example.com/QXmpp")); - QCOMPARE(presence.status().type(), QXmppPresence::Status::Away); - QCOMPARE(presence.status().statusText(), QString("In a meeting")); - QCOMPARE(presence.status().priority(), 5); + QCOMPARE(presence.availableStatusType(), QXmppPresence::Away); + QCOMPARE(presence.statusText(), QString("In a meeting")); + QCOMPARE(presence.priority(), 5); QCOMPARE(presence.photoHash(), QByteArray::fromHex("73b908bc")); QCOMPARE(presence.vCardUpdateType(), QXmppPresence::VCardUpdateValidPhoto); QCOMPARE(presence.capabilityHash(), QString("sha-1")); -- cgit v1.2.3