From ca76b24e1af920cbc2c07b950dd1dad81ff98dc5 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Fri, 30 Oct 2020 15:54:24 +0100 Subject: SaslClientScram: Refactor to simplify adding new algorithms Adding new algorithms only needs a new name/algorithm entry now. --- tests/qxmppsasl/tst_qxmppsasl.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/qxmppsasl/tst_qxmppsasl.cpp b/tests/qxmppsasl/tst_qxmppsasl.cpp index 5121ea5a..cb216ba7 100644 --- a/tests/qxmppsasl/tst_qxmppsasl.cpp +++ b/tests/qxmppsasl/tst_qxmppsasl.cpp @@ -190,14 +190,18 @@ void tst_QXmppSasl::testSuccess() void tst_QXmppSasl::testClientAvailableMechanisms() { - QCOMPARE(QXmppSaslClient::availableMechanisms(), QStringList() << "SCRAM-SHA-256" - << "SCRAM-SHA-1" - << "DIGEST-MD5" - << "PLAIN" - << "ANONYMOUS" - << "X-FACEBOOK-PLATFORM" - << "X-MESSENGER-OAUTH2" - << "X-OAUTH2"); + const QStringList expectedMechanisms = { + "SCRAM-SHA-256", + "SCRAM-SHA-1", + "DIGEST-MD5", + "PLAIN", + "ANONYMOUS", + "X-FACEBOOK-PLATFORM", + "X-MESSENGER-OAUTH2", + "X-OAUTH2" + }; + + QCOMPARE(QXmppSaslClient::availableMechanisms(), expectedMechanisms); } void tst_QXmppSasl::testClientBadMechanism() -- cgit v1.2.3