diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-05 14:59:18 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-05 14:59:18 +0200 |
| commit | 49d30871e8a605bea9679353afd9a6fb6a877664 (patch) | |
| tree | 102eb880ac7294846f373a628d2c4afed705910f /tests/sasl.cpp | |
| parent | 77782aecceb4ea7885d50f61afb8b2cae554960b (diff) | |
| download | qxmpp-49d30871e8a605bea9679353afd9a6fb6a877664.tar.gz | |
add tests for X-MESSENGER-OAUTH2 auth method
Diffstat (limited to 'tests/sasl.cpp')
| -rw-r--r-- | tests/sasl.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/sasl.cpp b/tests/sasl.cpp index 2eb5d5a2..7cf2097d 100644 --- a/tests/sasl.cpp +++ b/tests/sasl.cpp @@ -153,7 +153,7 @@ void tst_QXmppSasl::testSuccess() void tst_QXmppSaslClient::testAvailableMechanisms() { - QCOMPARE(QXmppSaslClient::availableMechanisms(), QStringList() << "PLAIN" << "DIGEST-MD5" << "ANONYMOUS" << "X-FACEBOOK-PLATFORM"); + QCOMPARE(QXmppSaslClient::availableMechanisms(), QStringList() << "PLAIN" << "DIGEST-MD5" << "ANONYMOUS" << "X-FACEBOOK-PLATFORM" << "X-MESSENGER-OAUTH2"); } void tst_QXmppSaslClient::testBadMechanism() @@ -263,6 +263,25 @@ void tst_QXmppSaslClient::testPlain() delete client; } +void tst_QXmppSaslClient::testWindowsLive() +{ + QXmppSaslClient *client = QXmppSaslClient::create("X-MESSENGER-OAUTH2"); + QVERIFY(client != 0); + QCOMPARE(client->mechanism(), QLatin1String("X-MESSENGER-OAUTH2")); + + client->setPassword(QByteArray("footoken").toBase64()); + + // initial step returns data + QByteArray response; + QVERIFY(client->respond(QByteArray(), response)); + QCOMPARE(response, QByteArray("footoken", 8)); + + // any further step is an error + QVERIFY(!client->respond(QByteArray(), response)); + + delete client; +} + void tst_QXmppSaslServer::testBadMechanism() { QXmppSaslServer *server = QXmppSaslServer::create("BAD-MECH"); |
