mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-04 16:25:27 +08:00
qt 6.5.1 original
This commit is contained in:
4
tests/benchmarks/network/ssl/CMakeLists.txt
Normal file
4
tests/benchmarks/network/ssl/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
add_subdirectory(qsslsocket)
|
14
tests/benchmarks/network/ssl/qsslsocket/CMakeLists.txt
Normal file
14
tests/benchmarks/network/ssl/qsslsocket/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## tst_bench_qsslsocket Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_benchmark(tst_bench_qsslsocket
|
||||
SOURCES
|
||||
tst_qsslsocket.cpp
|
||||
LIBRARIES
|
||||
Qt::Network
|
||||
Qt::Test
|
||||
)
|
75
tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
Normal file
75
tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QTest>
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
#include <qsslconfiguration.h>
|
||||
#include <qsslsocket.h>
|
||||
|
||||
|
||||
#include "../../../../auto/network-settings.h"
|
||||
|
||||
class tst_QSslSocket : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
tst_QSslSocket();
|
||||
virtual ~tst_QSslSocket();
|
||||
|
||||
|
||||
public slots:
|
||||
void initTestCase();
|
||||
void init();
|
||||
void cleanup();
|
||||
private slots:
|
||||
void rootCertLoading();
|
||||
void systemCaCertificates();
|
||||
};
|
||||
|
||||
tst_QSslSocket::tst_QSslSocket()
|
||||
{
|
||||
}
|
||||
|
||||
tst_QSslSocket::~tst_QSslSocket()
|
||||
{
|
||||
}
|
||||
|
||||
void tst_QSslSocket::initTestCase()
|
||||
{
|
||||
if (!QtNetworkSettings::verifyTestNetworkSettings())
|
||||
QSKIP("No network test server available");
|
||||
}
|
||||
|
||||
void tst_QSslSocket::init()
|
||||
{
|
||||
}
|
||||
|
||||
void tst_QSslSocket::cleanup()
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
void tst_QSslSocket::rootCertLoading()
|
||||
{
|
||||
QBENCHMARK_ONCE {
|
||||
QSslSocket socket;
|
||||
socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
|
||||
socket.waitForEncrypted();
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QSslSocket::systemCaCertificates()
|
||||
{
|
||||
// The results of this test change if the benchmarking system changes too much.
|
||||
// Therefore this benchmark is only good for manual regression checking between
|
||||
// Qt versions.
|
||||
QBENCHMARK_ONCE {
|
||||
QList<QSslCertificate> list = QSslConfiguration::defaultConfiguration().systemCaCertificates();
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QSslSocket)
|
||||
#include "tst_qsslsocket.moc"
|
Reference in New Issue
Block a user