aboutsummaryrefslogtreecommitdiff
path: root/tests/qxmppstreamfeatures/tst_qxmppstreamfeatures.cpp
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-04-05 13:53:04 +0200
committerLNJ <lnj@kaidan.im>2020-04-05 16:31:44 +0200
commitf3aa893f5165feb3020b691434c7ce17119559fd (patch)
treeaccedbb24846aa77af1e6cafa80082d7ded9ce61 /tests/qxmppstreamfeatures/tst_qxmppstreamfeatures.cpp
parent420fddae862b0f67e7d8fe712006525c0239154e (diff)
downloadqxmpp-f3aa893f5165feb3020b691434c7ce17119559fd.tar.gz
Add pre-approved presence subscriptions stream feature
Diffstat (limited to 'tests/qxmppstreamfeatures/tst_qxmppstreamfeatures.cpp')
-rw-r--r--tests/qxmppstreamfeatures/tst_qxmppstreamfeatures.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/qxmppstreamfeatures/tst_qxmppstreamfeatures.cpp b/tests/qxmppstreamfeatures/tst_qxmppstreamfeatures.cpp
index 028a20ef..72a0e31d 100644
--- a/tests/qxmppstreamfeatures/tst_qxmppstreamfeatures.cpp
+++ b/tests/qxmppstreamfeatures/tst_qxmppstreamfeatures.cpp
@@ -48,6 +48,7 @@ void tst_QXmppStreamFeatures::testEmpty()
QCOMPARE(features.tlsMode(), QXmppStreamFeatures::Disabled);
QCOMPARE(features.clientStateIndicationMode(), QXmppStreamFeatures::Disabled);
QCOMPARE(features.registerMode(), QXmppStreamFeatures::Disabled);
+ QCOMPARE(features.preApprovedSubscriptionsSupported(), false);
QCOMPARE(features.authMechanisms(), QStringList());
QCOMPARE(features.compressionMethods(), QStringList());
serializePacket(features, xml);
@@ -77,6 +78,7 @@ void tst_QXmppStreamFeatures::testFull()
"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>"
"<csi xmlns=\"urn:xmpp:csi:0\"/>"
"<register xmlns=\"http://jabber.org/features/iq-register\"/>"
+ "<sub xmlns=\"urn:xmpp:features:pre-approval\"/>"
"<compression xmlns=\"http://jabber.org/features/compress\"><method>zlib</method></compression>"
"<mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"><mechanism>PLAIN</mechanism></mechanisms>"
"</stream:features>");
@@ -89,9 +91,22 @@ void tst_QXmppStreamFeatures::testFull()
QCOMPARE(features.tlsMode(), QXmppStreamFeatures::Enabled);
QCOMPARE(features.clientStateIndicationMode(), QXmppStreamFeatures::Enabled);
QCOMPARE(features.registerMode(), QXmppStreamFeatures::Enabled);
+ QCOMPARE(features.preApprovedSubscriptionsSupported(), true);
QCOMPARE(features.authMechanisms(), QStringList() << "PLAIN");
QCOMPARE(features.compressionMethods(), QStringList() << "zlib");
serializePacket(features, xml);
+
+ features = QXmppStreamFeatures();
+ features.setBindMode(QXmppStreamFeatures::Enabled);
+ features.setSessionMode(QXmppStreamFeatures::Enabled);
+ features.setNonSaslAuthMode(QXmppStreamFeatures::Enabled);
+ features.setTlsMode(QXmppStreamFeatures::Enabled);
+ features.setClientStateIndicationMode(QXmppStreamFeatures::Enabled);
+ features.setRegisterMode(QXmppStreamFeatures::Enabled);
+ features.setPreApprovedSubscriptionsSupported(true);
+ features.setAuthMechanisms(QStringList { QStringLiteral("PLAIN") });
+ features.setCompressionMethods(QStringList { QStringLiteral("zlib") });
+ serializePacket(features, xml);
}
void tst_QXmppStreamFeatures::testSetters()