summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/network/ssl
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-09-28 12:43:55 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-09-28 12:52:32 (GMT)
commit434e40dbb2726f1a3204b4ea3fcee7c531467e42 (patch)
treea928f3de28e01e4a65a48f2fd8c75ab4b5910e93 /tests/benchmarks/network/ssl
parent8c316faaeb6efdc82d3c17e03bd0e83da9783e6f (diff)
downloadQt-434e40dbb2726f1a3204b4ea3fcee7c531467e42.zip
Qt-434e40dbb2726f1a3204b4ea3fcee7c531467e42.tar.gz
Qt-434e40dbb2726f1a3204b4ea3fcee7c531467e42.tar.bz2
SSL: Add benchmark for QSslSocket::systemCaCertificates()
Task-number: QTBUG-14013 Reviewed-by: Peter Hartmann
Diffstat (limited to 'tests/benchmarks/network/ssl')
-rw-r--r--tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro13
-rw-r--r--tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp103
-rw-r--r--tests/benchmarks/network/ssl/ssl.pro3
3 files changed, 119 insertions, 0 deletions
diff --git a/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro b/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro
new file mode 100644
index 0000000..da34a02
--- /dev/null
+++ b/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_qsslsocket
+DEPENDPATH += .
+INCLUDEPATH += .
+
+QT -= gui
+QT += network
+
+CONFIG += release
+
+# Input
+SOURCES += tst_qsslsocket.cpp
diff --git a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
new file mode 100644
index 0000000..79f502c
--- /dev/null
+++ b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <qcoreapplication.h>
+#include <qsslconfiguration.h>
+#include <qsslsocket.h>
+
+
+// #include "../../../../auto/network-settings.h"
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+class tst_QSslSocket : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QSslSocket();
+ virtual ~tst_QSslSocket();
+
+
+public slots:
+ void initTestCase_data();
+ void init();
+ void cleanup();
+private slots:
+ void systemCaCertificates();
+};
+
+tst_QSslSocket::tst_QSslSocket()
+{
+}
+
+tst_QSslSocket::~tst_QSslSocket()
+{
+}
+
+void tst_QSslSocket::initTestCase_data()
+{
+}
+
+void tst_QSslSocket::init()
+{
+}
+
+void tst_QSslSocket::cleanup()
+{
+}
+
+//----------------------------------------------------------------------------------
+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 = QSslSocket::systemCaCertificates();
+ }
+}
+
+QTEST_MAIN(tst_QSslSocket)
+#include "tst_qsslsocket.moc"
diff --git a/tests/benchmarks/network/ssl/ssl.pro b/tests/benchmarks/network/ssl/ssl.pro
new file mode 100644
index 0000000..0c8529d
--- /dev/null
+++ b/tests/benchmarks/network/ssl/ssl.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+SUBDIRS = \
+ qsslsocket