From 5a701f5a7ea435096836afe01905bf8c13c465e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 29 Apr 2021 13:02:52 +0200 Subject: Add function to QAuthenticatorPrivate to check method support To see if a certain method is supported. To be used in an upcoming patch. Change-Id: I1a5c2f655585331820701bb54f6991b4aba38273 Reviewed-by: Edward Welbourne Reviewed-by: Timur Pocheptsov --- .../kernel/qauthenticator/tst_qauthenticator.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/auto/network/kernel/qauthenticator') diff --git a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp index df5543a28e..529386f50f 100644 --- a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp +++ b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp @@ -49,6 +49,8 @@ private Q_SLOTS: void ntlmAuth(); void equalityOperators(); + + void isMethodSupported(); }; tst_QAuthenticator::tst_QAuthenticator() @@ -163,6 +165,22 @@ void tst_QAuthenticator::equalityOperators() QVERIFY(s2 != s1); } +void tst_QAuthenticator::isMethodSupported() +{ + QVERIFY(QAuthenticatorPrivate::isMethodSupported("basic")); + QVERIFY(QAuthenticatorPrivate::isMethodSupported("Basic realm=\"Shadow\"")); + QVERIFY(QAuthenticatorPrivate::isMethodSupported("DIgesT")); + QVERIFY(QAuthenticatorPrivate::isMethodSupported("NTLM")); + QVERIFY(QAuthenticatorPrivate::isMethodSupported("ntlm")); +#if QT_CONFIG(sspi) || QT_CONFIG(gssapi) + QVERIFY(QAuthenticatorPrivate::isMethodSupported("negotiate")); +#else + QVERIFY(!QAuthenticatorPrivate::isMethodSupported("negotiate")); +#endif + + QVERIFY(!QAuthenticatorPrivate::isMethodSupported("Bearer")); +} + QTEST_MAIN(tst_QAuthenticator); #include "tst_qauthenticator.moc" -- cgit v1.2.3