summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/network/socket
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/network/socket')
-rw-r--r--tests/benchmarks/network/socket/CMakeLists.txt3
-rw-r--r--tests/benchmarks/network/socket/qlocalsocket/CMakeLists.txt8
-rw-r--r--tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp10
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt8
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp2
-rw-r--r--tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt8
-rw-r--r--tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp2
7 files changed, 20 insertions, 21 deletions
diff --git a/tests/benchmarks/network/socket/CMakeLists.txt b/tests/benchmarks/network/socket/CMakeLists.txt
index 7c122a73ef..034f618737 100644
--- a/tests/benchmarks/network/socket/CMakeLists.txt
+++ b/tests/benchmarks/network/socket/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from socket.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qlocalsocket)
add_subdirectory(qtcpserver)
diff --git a/tests/benchmarks/network/socket/qlocalsocket/CMakeLists.txt b/tests/benchmarks/network/socket/qlocalsocket/CMakeLists.txt
index 7c56b0b946..660f2ee5b4 100644
--- a/tests/benchmarks/network/socket/qlocalsocket/CMakeLists.txt
+++ b/tests/benchmarks/network/socket/qlocalsocket/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
#####################################################################
## tst_bench_qlocalsocket Binary:
#####################################################################
@@ -5,10 +8,7 @@
qt_internal_add_benchmark(tst_bench_qlocalsocket
SOURCES
tst_qlocalsocket.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Network
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qlocalsocket.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index dc88adb975..a28869f24c 100644
--- a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -1,6 +1,6 @@
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2021 Alex Trotsenko <alex1973tr@gmail.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
#include <QtTest/qtesteventloop.h>
@@ -14,6 +14,8 @@
#include <QtNetwork/qlocalsocket.h>
#include <QtNetwork/qlocalserver.h>
+using namespace std::chrono_literals;
+
class tst_QLocalSocket : public QObject
{
Q_OBJECT
@@ -175,7 +177,7 @@ void tst_QLocalSocket::dataExchange()
QFETCH(int, chunkSize);
Q_ASSERT(chunkSize > 0 && connections > 0);
- const qint64 timeToTest = 5000;
+ const auto timeToTest = 5000ms;
ServerThread serverThread(chunkSize);
serverThread.start();
@@ -191,7 +193,7 @@ void tst_QLocalSocket::dataExchange()
Q_UNUSED(channel);
totalReceived += bytes;
- if (timer.elapsed() >= timeToTest) {
+ if (timer.elapsed() >= timeToTest.count()) {
factory.stopped = true;
eventLoop.exitLoop();
}
@@ -199,7 +201,7 @@ void tst_QLocalSocket::dataExchange()
timer.start();
emit factory.start();
- eventLoop.enterLoopMSecs(timeToTest * 2);
+ eventLoop.enterLoop(timeToTest * 2);
if (!QTest::currentTestFailed())
qDebug("Transfer rate: %.1f MB/s", totalReceived / 1048.576 / timer.elapsed());
diff --git a/tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt b/tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt
index f566c4f341..ae2f491df0 100644
--- a/tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt
+++ b/tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qtcpserver.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qtcpserver Binary:
@@ -7,10 +8,7 @@
qt_internal_add_benchmark(tst_bench_qtcpserver
SOURCES
tst_qtcpserver.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Network
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qtcpserver.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
index 501b5c37b4..68d60261d5 100644
--- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
#include <QtCore/QElapsedTimer>
diff --git a/tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt b/tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt
index 02293cdae6..0a39e8fc0c 100644
--- a/tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt
+++ b/tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qudpsocket.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qudpsocket Binary:
@@ -7,10 +8,7 @@
qt_internal_add_benchmark(tst_bench_qudpsocket
SOURCES
tst_qudpsocket.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Network
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qudpsocket.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp
index c41a5b3b18..d3ef636e74 100644
--- a/tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/benchmarks/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2019 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
#include <QtCore/qglobal.h>