aboutsummaryrefslogtreecommitdiff
path: root/tests/presence.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-07-21 16:04:36 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-07-21 16:04:36 +0200
commitaefa4f51b84542c1203930323da74d603a8d9345 (patch)
tree20a0dc86723a192a048cd88f2bc177e81a4cc441 /tests/presence.cpp
parent43451285e6385261c556c49597eea4f8c3c94e25 (diff)
downloadqxmpp-aefa4f51b84542c1203930323da74d603a8d9345.tar.gz
use new QXmppPresence constants
Diffstat (limited to 'tests/presence.cpp')
-rw-r--r--tests/presence.cpp28
1 files changed, 14 insertions, 14 deletions
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<int>("vcardUpdate");
QTest::addColumn<QByteArray>("photoHash");
- QTest::newRow("empty") << QByteArray("<presence/>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
- QTest::newRow("unavailable") << QByteArray("<presence type=\"unavailable\"/>") << int(QXmppPresence::Unavailable) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
- QTest::newRow("error") << QByteArray("<presence type=\"error\"/>") << int(QXmppPresence::Error) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("empty") << QByteArray("<presence/>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("unavailable") << QByteArray("<presence type=\"unavailable\"/>") << int(QXmppPresence::Unavailable) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("error") << QByteArray("<presence type=\"error\"/>") << int(QXmppPresence::Error) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
- QTest::newRow("full") << QByteArray("<presence><show>away</show><status>In a meeting</status><priority>5</priority></presence>") << int(QXmppPresence::Available) << 5 << int(QXmppPresence::Status::Away) << "In a meeting" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("full") << QByteArray("<presence><show>away</show><status>In a meeting</status><priority>5</priority></presence>") << int(QXmppPresence::Available) << 5 << int(QXmppPresence::Away) << "In a meeting" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
// status type
- QTest::newRow("away") << QByteArray("<presence><show>away</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Away) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
- QTest::newRow("dnd") << QByteArray("<presence><show>dnd</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::DND) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
- QTest::newRow("chat") << QByteArray("<presence><show>chat</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Chat) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
- QTest::newRow("xa") << QByteArray("<presence><show>xa</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::XA) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
- QTest::newRow("invisible") << QByteArray("<presence><show>invisible</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Invisible) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("away") << QByteArray("<presence><show>away</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Away) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("dnd") << QByteArray("<presence><show>dnd</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::DND) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("chat") << QByteArray("<presence><show>chat</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Chat) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("xa") << QByteArray("<presence><show>xa</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::XA) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
+ QTest::newRow("invisible") << QByteArray("<presence><show>invisible</show></presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Invisible) << "" << int(QXmppPresence::VCardUpdateNone) << QByteArray();
QTest::newRow("vcard-photo") << QByteArray(
"<presence>"
"<x xmlns=\"vcard-temp:x:update\">"
"<photo>73b908bc</photo>"
"</x>"
- "</presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateValidPhoto) << QByteArray::fromHex("73b908bc");
+ "</presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Online) << "" << int(QXmppPresence::VCardUpdateValidPhoto) << QByteArray::fromHex("73b908bc");
QTest::newRow("vard-not-ready") << QByteArray(
"<presence>"
"<x xmlns=\"vcard-temp:x:update\"/>"
- "</presence>") << int(QXmppPresence::Available) << 0 << int(QXmppPresence::Status::Online) << "" << int(QXmppPresence::VCardUpdateNotReady) << QByteArray();
+ "</presence>") << 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"));