summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2021-05-13 07:32:10 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2021-05-27 06:41:26 +0200
commit810e755c180212892dbd5a8784ffe9c99258862a (patch)
treefe60a5381fe24b4b3a210404e9dd07873aa2a9de /tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
parent71d242c6d38dad420bc01b14adde433146c02401 (diff)
Fix auto-tests that are fooled by the presence of more than one plugin
It's possible that Qt is built with OpenSSL and some other backend. The ifdefs generated are not mutually exclusive anymore, as it was in the past. So tests should rely on the actual backend they have working at runtime. In the process of fixing the auto-tests, modernized feature #if-ery and some associated compilation issues. Fixes: QTBUG-92875 Change-Id: I2be1b924d506fd36dc4e2c6c9158b5023ff87f32 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp')
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index 2845d9c59d..b35d6947df 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -48,9 +48,7 @@
// TLSTODO: find another solution, for now this code
// (OpenSSL specific) is a part of plugin, not in
// QtNetwork anymore.
- //#ifndef QT_NO_OPENSSL
// #include "private/qsslsocket_openssl_symbols_p.h"
- //#endif
#endif
#if QT_CONFIG(ssl)
@@ -244,12 +242,12 @@ void tst_QSslKey::createPlainTestRows(bool pemOnly)
continue; // Schannel treats RC2 as 128 bit
}
-#if QT_CONFIG(ssl) && defined(QT_NO_OPENSSL) // generic backend
- if (keyInfo.fileInfo.fileName().contains(QRegularExpression("-aes\\d\\d\\d-")))
- continue; // No AES support in the generic back-end
- if (keyInfo.fileInfo.fileName().contains("pkcs8-pkcs12"))
- continue; // The generic back-end doesn't support PKCS#12 algorithms
-#endif
+ if (isSchannel || isSecureTransport) {
+ if (keyInfo.fileInfo.fileName().contains(QRegularExpression("-aes\\d\\d\\d-")))
+ continue; // No AES support in the generic back-end
+ if (keyInfo.fileInfo.fileName().contains("pkcs8-pkcs12"))
+ continue; // The generic back-end doesn't support PKCS#12 algorithms
+ }
QTest::newRow(keyInfo.fileInfo.fileName().toLatin1())
<< keyInfo.fileInfo.absoluteFilePath() << keyInfo.algorithm << keyInfo.type