Standardise layout and naming in corelib benchmarks

Make file names match CMake's test names (and those follow dir-name)
and class names follow tst_ClassName pattern when testing
ClassName. Purge comments about the qmake configs the CMakeLists.txt
are generated from.  Purge empty constructors and init/cleanup methods
of classes.  Fix petty coding style violations.

Add qdir/tree/, qurl, qbench and qset benchmarks to their parent directories'
lists of subdirs. Fix unused return error from qurl benchmark.

Change-Id: Ifc15a3a46e71cf82ad0637753517e0df34049763
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2021-08-18 11:48:29 +02:00
parent c2a6749af7
commit 9004a2412b
95 changed files with 359 additions and 524 deletions

View File

@ -1,12 +1,11 @@
# Generated from io.pro.
add_subdirectory(qdir) add_subdirectory(qdir)
add_subdirectory(qdiriterator) add_subdirectory(qdiriterator)
add_subdirectory(qfile) add_subdirectory(qfile)
add_subdirectory(qfileinfo) add_subdirectory(qfileinfo)
add_subdirectory(qiodevice) add_subdirectory(qiodevice)
add_subdirectory(qtemporaryfile)
add_subdirectory(qtextstream)
if(QT_FEATURE_process) if(QT_FEATURE_process)
add_subdirectory(qprocess) add_subdirectory(qprocess)
endif() endif()
add_subdirectory(qtemporaryfile)
add_subdirectory(qtextstream)
add_subdirectory(qurl)

View File

@ -1,15 +1,10 @@
# Generated from 10000.pro.
##################################################################### #####################################################################
## tst_bench_qdir_10000 Binary: ## tst_bench_qdir_10000 Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qdir_10000 qt_internal_add_benchmark(tst_bench_qdir_10000
SOURCES SOURCES
bench_qdir_10000.cpp tst_bench_qdir_10000.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:10000.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -38,10 +38,12 @@
# include <unistd.h> # include <unistd.h>
#endif #endif
class bench_QDir_10000 : public QObject{ class tst_QDir_10000 : public QObject
Q_OBJECT {
Q_OBJECT
public slots: public slots:
void initTestCase() { void initTestCase()
{
QDir testdir = QDir::tempPath(); QDir testdir = QDir::tempPath();
const QString subfolder_name = QLatin1String("test_speed"); const QString subfolder_name = QLatin1String("test_speed");
@ -53,7 +55,8 @@ public slots:
file.open(QIODevice::WriteOnly); file.open(QIODevice::WriteOnly);
} }
} }
void cleanupTestCase() { void cleanupTestCase()
{
{ {
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
testdir.setSorting(QDir::Unsorted); testdir.setSorting(QDir::Unsorted);
@ -68,7 +71,8 @@ public slots:
private slots: private slots:
void baseline() {} void baseline() {}
void sizeSpeed() { void sizeSpeed()
{
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
QBENCHMARK { QBENCHMARK {
QFileInfoList fileInfoList = testdir.entryInfoList(QDir::Files, QDir::Unsorted); QFileInfoList fileInfoList = testdir.entryInfoList(QDir::Files, QDir::Unsorted);
@ -78,7 +82,8 @@ private slots:
} }
} }
} }
void sizeSpeedIterator() { void sizeSpeedIterator()
{
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
QBENCHMARK { QBENCHMARK {
QDirIterator dit(testdir.path(), QDir::Files); QDirIterator dit(testdir.path(), QDir::Files);
@ -90,7 +95,8 @@ private slots:
} }
} }
void sizeSpeedWithoutFilter() { void sizeSpeedWithoutFilter()
{
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
QBENCHMARK { QBENCHMARK {
QFileInfoList fileInfoList = testdir.entryInfoList(QDir::NoFilter, QDir::Unsorted); QFileInfoList fileInfoList = testdir.entryInfoList(QDir::NoFilter, QDir::Unsorted);
@ -99,7 +105,8 @@ private slots:
} }
} }
} }
void sizeSpeedWithoutFilterIterator() { void sizeSpeedWithoutFilterIterator()
{
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
QBENCHMARK { QBENCHMARK {
QDirIterator dit(testdir.path()); QDirIterator dit(testdir.path());
@ -111,7 +118,8 @@ private slots:
} }
} }
void sizeSpeedWithoutFileInfoList() { void sizeSpeedWithoutFileInfoList()
{
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
testdir.setSorting(QDir::Unsorted); testdir.setSorting(QDir::Unsorted);
QBENCHMARK { QBENCHMARK {
@ -123,7 +131,8 @@ private slots:
} }
} }
void iDontWantAnyStat() { void iDontWantAnyStat()
{
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
testdir.setSorting(QDir::Unsorted); testdir.setSorting(QDir::Unsorted);
testdir.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden); testdir.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden);
@ -134,7 +143,8 @@ private slots:
} }
} }
} }
void iDontWantAnyStatIterator() { void iDontWantAnyStatIterator()
{
QBENCHMARK { QBENCHMARK {
QDirIterator dit(QDir::tempPath() + QLatin1String("/test_speed")); QDirIterator dit(QDir::tempPath() + QLatin1String("/test_speed"));
while (dit.hasNext()) { while (dit.hasNext()) {
@ -143,7 +153,8 @@ private slots:
} }
} }
void sorted_byTime() { void sorted_byTime()
{
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
testdir.setSorting(QDir::Time); testdir.setSorting(QDir::Time);
testdir.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden); testdir.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden);
@ -155,7 +166,8 @@ private slots:
} }
} }
void sizeSpeedWithoutFilterLowLevel() { void sizeSpeedWithoutFilterLowLevel()
{
QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
const wchar_t *dirpath = (wchar_t*)testdir.absolutePath().utf16(); const wchar_t *dirpath = (wchar_t*)testdir.absolutePath().utf16();
@ -194,5 +206,6 @@ private slots:
} }
}; };
QTEST_MAIN(bench_QDir_10000) QTEST_MAIN(tst_QDir_10000)
#include "bench_qdir_10000.moc"
#include "tst_bench_qdir_10000.moc"

View File

@ -1,3 +1,2 @@
# Generated from qdir.pro.
add_subdirectory(10000) add_subdirectory(10000)
add_subdirectory(tree)

View File

@ -1,28 +1,22 @@
# Generated from tree.pro.
##################################################################### #####################################################################
## bench_qdir_tree Binary: ## tst_bench_qdir_tree Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(bench_qdir_tree qt_internal_add_benchmark(tst_bench_qdir_tree
SOURCES SOURCES
bench_qdir_tree.cpp tst_bench_qdir_tree.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
# Resources: # Resources:
set(bench_qdir_tree_resource_files set(qdir_tree_resource_files
"4.6.0-list.txt" "4.6.0-list.txt"
) )
qt_internal_add_resource(bench_qdir_tree "bench_qdir_tree" qt_internal_add_resource(tst_bench_qdir_tree "tst_bench_qdir_tree"
PREFIX PREFIX
"/" "/"
FILES FILES
${bench_qdir_tree_resource_files} ${qdir_tree_resource_files}
) )
#### Keys ignored in scope 1:.:.:tree.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -35,13 +35,13 @@
#include "../../../../../shared/filesystem.h" #include "../../../../../shared/filesystem.h"
class bench_QDir_tree class tst_QDir_tree
: public QObject : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
bench_QDir_tree() tst_QDir_tree()
: prefix("test-tree/"), : prefix("test-tree/"),
musicprefix(QLatin1String("music")), musicprefix(QLatin1String("music")),
photoprefix(QLatin1String("photos")), photoprefix(QLatin1String("photos")),
@ -221,5 +221,6 @@ private slots:
} }
}; };
QTEST_MAIN(bench_QDir_tree) QTEST_MAIN(tst_QDir_tree)
#include "bench_qdir_tree.moc"
#include "tst_bench_qdir_tree.moc"

View File

@ -1,12 +1,10 @@
# Generated from qdiriterator.pro.
##################################################################### #####################################################################
## tst_bench_qdiriterator Binary: ## tst_bench_qdiriterator Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qdiriterator qt_internal_add_benchmark(tst_bench_qdiriterator
SOURCES SOURCES
main.cpp tst_bench_qdiriterator.cpp
qfilesystemiterator.cpp qfilesystemiterator.h qfilesystemiterator.cpp qfilesystemiterator.h
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test

View File

@ -48,7 +48,7 @@
#include <filesystem> #include <filesystem>
#endif #endif
class tst_qdiriterator : public QObject class tst_QDirIterator : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -64,7 +64,7 @@ private slots:
void stdRecursiveDirectoryIterator_data() { data(); } void stdRecursiveDirectoryIterator_data() { data(); }
}; };
void tst_qdiriterator::data() void tst_QDirIterator::data()
{ {
const char hereRelative[] = "tests/benchmarks/corelib/io/qdiriterator"; const char hereRelative[] = "tests/benchmarks/corelib/io/qdiriterator";
QByteArray dir(QT_TESTCASE_SOURCEDIR); QByteArray dir(QT_TESTCASE_SOURCEDIR);
@ -155,7 +155,7 @@ static int posix_helper(const char *dirpath)
#endif #endif
void tst_qdiriterator::posix() void tst_QDirIterator::posix()
{ {
QFETCH(QByteArray, dirpath); QFETCH(QByteArray, dirpath);
@ -173,7 +173,7 @@ void tst_qdiriterator::posix()
qDebug() << count; qDebug() << count;
} }
void tst_qdiriterator::diriterator() void tst_QDirIterator::diriterator()
{ {
QFETCH(QByteArray, dirpath); QFETCH(QByteArray, dirpath);
@ -203,7 +203,7 @@ void tst_qdiriterator::diriterator()
qDebug() << count; qDebug() << count;
} }
void tst_qdiriterator::fsiterator() void tst_QDirIterator::fsiterator()
{ {
QFETCH(QByteArray, dirpath); QFETCH(QByteArray, dirpath);
@ -235,7 +235,7 @@ void tst_qdiriterator::fsiterator()
qDebug() << count; qDebug() << count;
} }
void tst_qdiriterator::stdRecursiveDirectoryIterator() void tst_QDirIterator::stdRecursiveDirectoryIterator()
{ {
#if QT_CONFIG(cxx17_filesystem) #if QT_CONFIG(cxx17_filesystem)
QFETCH(QByteArray, dirpath); QFETCH(QByteArray, dirpath);
@ -257,6 +257,6 @@ void tst_qdiriterator::stdRecursiveDirectoryIterator()
#endif #endif
} }
QTEST_MAIN(tst_qdiriterator) QTEST_MAIN(tst_QDirIterator)
#include "main.moc" #include "tst_bench_qdiriterator.moc"

View File

@ -1,16 +1,11 @@
# Generated from qfileinfo.pro.
##################################################################### #####################################################################
## tst_bench_qfileinfo Binary: ## tst_bench_qfileinfo Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qfileinfo qt_internal_add_benchmark(tst_bench_qfileinfo
SOURCES SOURCES
main.cpp tst_bench_qfileinfo.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::CorePrivate Qt::CorePrivate
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qfileinfo.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -35,7 +35,7 @@
#include "private/qfsfileengine_p.h" #include "private/qfsfileengine_p.h"
#include "../../../../shared/filesystem.h" #include "../../../../shared/filesystem.h"
class qfileinfo : public QObject class tst_QFileInfo : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -45,34 +45,22 @@ private slots:
void symLinkTargetPerformanceLNK(); void symLinkTargetPerformanceLNK();
void junctionTargetPerformanceMountpoint(); void junctionTargetPerformanceMountpoint();
#endif #endif
void initTestCase();
void cleanupTestCase();
public:
qfileinfo() : QObject() {};
}; };
void qfileinfo::initTestCase() void tst_QFileInfo::existsTemporary()
{
}
void qfileinfo::cleanupTestCase()
{
}
void qfileinfo::existsTemporary()
{ {
QString appPath = QCoreApplication::applicationFilePath(); QString appPath = QCoreApplication::applicationFilePath();
QBENCHMARK { QFileInfo(appPath).exists(); } QBENCHMARK { QFileInfo(appPath).exists(); }
} }
void qfileinfo::existsStatic() void tst_QFileInfo::existsStatic()
{ {
QString appPath = QCoreApplication::applicationFilePath(); QString appPath = QCoreApplication::applicationFilePath();
QBENCHMARK { QFileInfo::exists(appPath); } QBENCHMARK { QFileInfo::exists(appPath); }
} }
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
void qfileinfo::symLinkTargetPerformanceLNK() void tst_QFileInfo::symLinkTargetPerformanceLNK()
{ {
QVERIFY(QFile::link("file","link.lnk")); QVERIFY(QFile::link("file","link.lnk"));
QFileInfo info("link.lnk"); QFileInfo info("link.lnk");
@ -86,7 +74,7 @@ void qfileinfo::symLinkTargetPerformanceLNK()
QVERIFY(QFile::remove("link.lnk")); QVERIFY(QFile::remove("link.lnk"));
} }
void qfileinfo::junctionTargetPerformanceMountpoint() void tst_QFileInfo::junctionTargetPerformanceMountpoint()
{ {
wchar_t buffer[MAX_PATH]; wchar_t buffer[MAX_PATH];
QString rootPath = QDir::toNativeSeparators(QDir::rootPath()); QString rootPath = QDir::toNativeSeparators(QDir::rootPath());
@ -109,6 +97,6 @@ void qfileinfo::junctionTargetPerformanceMountpoint()
} }
#endif #endif
QTEST_MAIN(qfileinfo) QTEST_MAIN(tst_QFileInfo)
#include "main.moc" #include "tst_bench_qfileinfo.moc"

View File

@ -1,15 +1,10 @@
# Generated from qiodevice.pro.
##################################################################### #####################################################################
## tst_bench_qiodevice Binary: ## tst_bench_qiodevice Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qiodevice qt_internal_add_benchmark(tst_bench_qiodevice
SOURCES SOURCES
main.cpp tst_bench_qiodevice.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qiodevice.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -32,8 +32,7 @@
#include <qtest.h> #include <qtest.h>
class tst_QIODevice : public QObject
class tst_qiodevice : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -48,7 +47,7 @@ private:
}; };
void tst_qiodevice::read_data() void tst_QIODevice::read_data()
{ {
QTest::addColumn<qint64>("size"); QTest::addColumn<qint64>("size");
QTest::newRow("10k") << qint64(10 * 1024); QTest::newRow("10k") << qint64(10 * 1024);
@ -59,7 +58,7 @@ void tst_qiodevice::read_data()
QTest::newRow("1000000k") << qint64(1000000 * 1024); QTest::newRow("1000000k") << qint64(1000000 * 1024);
} }
void tst_qiodevice::read_old() void tst_QIODevice::read_old()
{ {
QFETCH(qint64, size); QFETCH(qint64, size);
@ -88,7 +87,7 @@ void tst_qiodevice::read_old()
} }
} }
void tst_qiodevice::peekAndRead() void tst_QIODevice::peekAndRead()
{ {
QFETCH(qint64, size); QFETCH(qint64, size);
@ -119,6 +118,6 @@ void tst_qiodevice::peekAndRead()
} }
} }
QTEST_MAIN(tst_qiodevice) QTEST_MAIN(tst_QIODevice)
#include "main.moc" #include "tst_bench_qiodevice.moc"

View File

@ -1,5 +1,3 @@
# Generated from test.pro.
##################################################################### #####################################################################
## tst_bench_qprocess Binary: ## tst_bench_qprocess Binary:
##################################################################### #####################################################################

View File

@ -2,4 +2,4 @@
## testProcessLoopback Binary: ## testProcessLoopback Binary:
##################################################################### #####################################################################
add_executable(testProcessLoopback main.cpp) add_executable(testProcessLoopback loopback.cpp)

View File

@ -1,15 +1,10 @@
# Generated from qtemporaryfile.pro.
##################################################################### #####################################################################
## tst_bench_qtemporaryfile Binary: ## tst_bench_qtemporaryfile Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qtemporaryfile qt_internal_add_benchmark(tst_bench_qtemporaryfile
SOURCES SOURCES
main.cpp tst_bench_qtemporaryfile.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qtemporaryfile.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -32,8 +32,7 @@
#include <QTemporaryFile> #include <QTemporaryFile>
#include <qtest.h> #include <qtest.h>
class tst_QTemporaryFile : public QObject
class tst_qtemporaryfile : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -45,7 +44,7 @@ private slots:
private: private:
}; };
void tst_qtemporaryfile::openclose_data() void tst_QTemporaryFile::openclose_data()
{ {
QTest::addColumn<qint64>("amount"); QTest::addColumn<qint64>("amount");
QTest::newRow("100") << qint64(100); QTest::newRow("100") << qint64(100);
@ -53,7 +52,7 @@ void tst_qtemporaryfile::openclose_data()
QTest::newRow("10000") << qint64(10000); QTest::newRow("10000") << qint64(10000);
} }
void tst_qtemporaryfile::openclose() void tst_QTemporaryFile::openclose()
{ {
QFETCH(qint64, amount); QFETCH(qint64, amount);
@ -66,7 +65,7 @@ void tst_qtemporaryfile::openclose()
} }
} }
void tst_qtemporaryfile::readwrite() void tst_QTemporaryFile::readwrite()
{ {
QFETCH(qint64, amount); QFETCH(qint64, amount);
@ -85,6 +84,6 @@ void tst_qtemporaryfile::readwrite()
} }
} }
QTEST_MAIN(tst_qtemporaryfile) QTEST_MAIN(tst_QTemporaryFile)
#include "main.moc" #include "tst_bench_qtemporaryfile.moc"

View File

@ -1,15 +1,10 @@
# Generated from qtextstream.pro.
##################################################################### #####################################################################
## tst_bench_qtextstream Binary: ## tst_bench_qtextstream Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qtextstream qt_internal_add_benchmark(tst_bench_qtextstream
SOURCES SOURCES
main.cpp tst_bench_qtextstream.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qtextstream.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -32,7 +32,7 @@
#include <QBuffer> #include <QBuffer>
#include <qtest.h> #include <qtest.h>
class tst_qtextstream : public QObject class tst_QTextStream : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -48,7 +48,7 @@ Q_DECLARE_METATYPE(Output);
enum Input { CharStarInput, QStringInput, CharInput, QCharInput }; enum Input { CharStarInput, QStringInput, CharInput, QCharInput };
Q_DECLARE_METATYPE(Input); Q_DECLARE_METATYPE(Input);
void tst_qtextstream::writeSingleChar_data() void tst_QTextStream::writeSingleChar_data()
{ {
QTest::addColumn<Output>("output"); QTest::addColumn<Output>("output");
QTest::addColumn<Input>("input"); QTest::addColumn<Input>("input");
@ -63,7 +63,7 @@ void tst_qtextstream::writeSingleChar_data()
QTest::newRow("device_qchar") << DeviceOutput << QCharInput; QTest::newRow("device_qchar") << DeviceOutput << QCharInput;
} }
void tst_qtextstream::writeSingleChar() void tst_QTextStream::writeSingleChar()
{ {
QFETCH(Output, output); QFETCH(Output, output);
QFETCH(Input, input); QFETCH(Input, input);
@ -115,6 +115,6 @@ void tst_qtextstream::writeSingleChar()
QCOMPARE(result.left(10), QString("hhhhhhhhhh")); QCOMPARE(result.left(10), QString("hhhhhhhhhh"));
} }
QTEST_MAIN(tst_qtextstream) QTEST_MAIN(tst_QTextStream)
#include "main.moc" #include "tst_bench_qtextstream.moc"

View File

@ -1,23 +1,18 @@
# Generated from qurl.pro.
##################################################################### #####################################################################
## tst_qurl Binary: ## tst_qurl Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_qurl qt_internal_add_benchmark(tst_bench_qurl
SOURCES SOURCES
main.cpp tst_bench_qurl.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qurl.pro:<TRUE>:
# TEMPLATE = "app"
## Scopes: ## Scopes:
##################################################################### #####################################################################
qt_internal_extend_target(tst_qurl CONDITION WIN32 qt_internal_extend_target(tst_bench_qurl CONDITION WIN32
DEFINES DEFINES
_CRT_SECURE_NO_WARNINGS _CRT_SECURE_NO_WARNINGS
) )

View File

@ -29,7 +29,7 @@
#include <qurl.h> #include <qurl.h>
#include <qtest.h> #include <qtest.h>
class tst_qurl: public QObject class tst_QUrl : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -53,28 +53,28 @@ private:
void generateFirstRunData(); void generateFirstRunData();
}; };
void tst_qurl::emptyUrl() void tst_QUrl::emptyUrl()
{ {
QBENCHMARK { QBENCHMARK {
QUrl url; QUrl url;
} }
} }
void tst_qurl::relativeUrl() void tst_QUrl::relativeUrl()
{ {
QBENCHMARK { QBENCHMARK {
QUrl url("pics/avatar.png"); QUrl url("pics/avatar.png");
} }
} }
void tst_qurl::absoluteUrl() void tst_QUrl::absoluteUrl()
{ {
QBENCHMARK { QBENCHMARK {
QUrl url("/tmp/avatar.png"); QUrl url("/tmp/avatar.png");
} }
} }
void tst_qurl::generateFirstRunData() void tst_QUrl::generateFirstRunData()
{ {
QTest::addColumn<bool>("firstRun"); QTest::addColumn<bool>("firstRun");
@ -82,12 +82,12 @@ void tst_qurl::generateFirstRunData()
QTest::newRow("subsequent runs") << false; QTest::newRow("subsequent runs") << false;
} }
void tst_qurl::isRelative_data() void tst_QUrl::isRelative_data()
{ {
generateFirstRunData(); generateFirstRunData();
} }
void tst_qurl::isRelative() void tst_QUrl::isRelative()
{ {
QFETCH(bool, firstRun); QFETCH(bool, firstRun);
if (firstRun) { if (firstRun) {
@ -103,12 +103,12 @@ void tst_qurl::isRelative()
} }
} }
void tst_qurl::toLocalFile_data() void tst_QUrl::toLocalFile_data()
{ {
generateFirstRunData(); generateFirstRunData();
} }
void tst_qurl::toLocalFile() void tst_QUrl::toLocalFile()
{ {
QFETCH(bool, firstRun); QFETCH(bool, firstRun);
if (firstRun) { if (firstRun) {
@ -124,12 +124,12 @@ void tst_qurl::toLocalFile()
} }
} }
void tst_qurl::toString_data() void tst_QUrl::toString_data()
{ {
generateFirstRunData(); generateFirstRunData();
} }
void tst_qurl::toString() void tst_QUrl::toString()
{ {
QFETCH(bool, firstRun); QFETCH(bool, firstRun);
if(firstRun) { if(firstRun) {
@ -145,35 +145,37 @@ void tst_qurl::toString()
} }
} }
void tst_qurl::resolved_data() void tst_QUrl::resolved_data()
{ {
generateFirstRunData(); generateFirstRunData();
} }
void tst_qurl::resolved() void tst_QUrl::resolved()
{ {
QFETCH(bool, firstRun); QFETCH(bool, firstRun);
if(firstRun) { QUrl expect("/home/user/pics/avatar.png"), actual;
if (firstRun) {
QBENCHMARK { QBENCHMARK {
QUrl baseUrl("/home/user/"); QUrl baseUrl("/home/user/");
QUrl url("pics/avatar.png"); QUrl url("pics/avatar.png");
baseUrl.resolved(url); actual = baseUrl.resolved(url);
} }
} else { } else {
QUrl baseUrl("/home/user/"); QUrl baseUrl("/home/user/");
QUrl url("pics/avatar.png"); QUrl url("pics/avatar.png");
QBENCHMARK { QBENCHMARK {
baseUrl.resolved(url); actual = baseUrl.resolved(url);
} }
} }
QCOMPARE(actual, expect);
} }
void tst_qurl::equality_data() void tst_QUrl::equality_data()
{ {
generateFirstRunData(); generateFirstRunData();
} }
void tst_qurl::equality() void tst_QUrl::equality()
{ {
QFETCH(bool, firstRun); QFETCH(bool, firstRun);
if(firstRun) { if(firstRun) {
@ -191,7 +193,7 @@ void tst_qurl::equality()
} }
} }
void tst_qurl::qmlPropertyWriteUseCase() void tst_QUrl::qmlPropertyWriteUseCase()
{ {
QUrl base("file:///home/user/qt/examples/declarative/samegame/SamegameCore/"); QUrl base("file:///home/user/qt/examples/declarative/samegame/SamegameCore/");
QString str("pics/redStar.png"); QString str("pics/redStar.png");
@ -203,6 +205,6 @@ void tst_qurl::qmlPropertyWriteUseCase()
} }
} }
QTEST_MAIN(tst_qurl) QTEST_MAIN(tst_QUrl)
#include "main.moc" #include "tst_bench_qurl.moc"

View File

@ -1,6 +1,6 @@
qt_internal_add_benchmark(tst_bench_qsortfilterproxymodel qt_internal_add_benchmark(tst_bench_qsortfilterproxymodel
SOURCES SOURCES
tst_qsortfilterproxymodel.cpp tst_bench_qsortfilterproxymodel.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -120,4 +120,4 @@ void tst_QSortFilterProxyModel::clearFilter()
QTEST_MAIN(tst_QSortFilterProxyModel) QTEST_MAIN(tst_QSortFilterProxyModel)
#include "tst_qsortfilterproxymodel.moc" #include "tst_bench_qsortfilterproxymodel.moc"

View File

@ -1,15 +1,10 @@
# Generated from events.pro.
##################################################################### #####################################################################
## tst_bench_events Binary: ## tst_bench_events Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_events qt_internal_add_benchmark(tst_bench_events
SOURCES SOURCES
main.cpp tst_bench_events.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:events.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -171,4 +171,4 @@ void EventsBench::postEvent()
QTEST_MAIN(EventsBench) QTEST_MAIN(EventsBench)
#include "main.moc" #include "tst_bench_events.moc"

View File

@ -1,15 +1,10 @@
# Generated from qcoreapplication.pro.
##################################################################### #####################################################################
## tst_bench_qcoreapplication Binary: ## tst_bench_qcoreapplication Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qcoreapplication qt_internal_add_benchmark(tst_bench_qcoreapplication
SOURCES SOURCES
main.cpp tst_bench_qcoreapplication.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qcoreapplication.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -29,7 +29,7 @@
#include <qtest.h> #include <qtest.h>
#include <qcoreapplication.h> #include <qcoreapplication.h>
class QCoreApplicationBenchmark : public QObject class tst_QCoreApplication : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -37,7 +37,7 @@ private slots:
void event_posting_benchmark(); void event_posting_benchmark();
}; };
void QCoreApplicationBenchmark::event_posting_benchmark_data() void tst_QCoreApplication::event_posting_benchmark_data()
{ {
QTest::addColumn<int>("size"); QTest::addColumn<int>("size");
QTest::newRow("50 events") << 50; QTest::newRow("50 events") << 50;
@ -49,7 +49,7 @@ void QCoreApplicationBenchmark::event_posting_benchmark_data()
QTest::newRow("1000000 events") << 1000000; QTest::newRow("1000000 events") << 1000000;
} }
void QCoreApplicationBenchmark::event_posting_benchmark() void tst_QCoreApplication::event_posting_benchmark()
{ {
QFETCH(int, size); QFETCH(int, size);
@ -64,6 +64,6 @@ void QCoreApplicationBenchmark::event_posting_benchmark()
} }
} }
QTEST_MAIN(QCoreApplicationBenchmark) QTEST_MAIN(tst_QCoreApplication)
#include "main.moc" #include "tst_bench_qcoreapplication.moc"

View File

@ -1,17 +1,12 @@
# Generated from qmetaobject.pro.
##################################################################### #####################################################################
## tst_bench_qmetaobject Binary: ## tst_bench_qmetaobject Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qmetaobject qt_internal_add_benchmark(tst_bench_qmetaobject
SOURCES SOURCES
main.cpp tst_bench_qmetaobject.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Gui Qt::Gui
Qt::Test Qt::Test
Qt::Widgets Qt::Widgets
) )
#### Keys ignored in scope 1:.:.:qmetaobject.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -29,7 +29,7 @@
#include <QtWidgets/QTreeView> #include <QtWidgets/QTreeView>
#include <qtest.h> #include <qtest.h>
class LotsOfSignals : public QObject class LotsOfSignals : public QObject // for the unconnected() test
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -107,13 +107,10 @@ signals:
void extraSignal70(); void extraSignal70();
}; };
class tst_qmetaobject: public QObject class tst_QMetaObject: public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
void initTestCase();
void cleanupTestCase();
void indexOfProperty_data(); void indexOfProperty_data();
void indexOfProperty(); void indexOfProperty();
void indexOfMethod_data(); void indexOfMethod_data();
@ -127,15 +124,7 @@ private slots:
void unconnected(); void unconnected();
}; };
void tst_qmetaobject::initTestCase() void tst_QMetaObject::indexOfProperty_data()
{
}
void tst_qmetaobject::cleanupTestCase()
{
}
void tst_qmetaobject::indexOfProperty_data()
{ {
QTest::addColumn<QByteArray>("name"); QTest::addColumn<QByteArray>("name");
const QMetaObject *mo = &QTreeView::staticMetaObject; const QMetaObject *mo = &QTreeView::staticMetaObject;
@ -145,7 +134,7 @@ void tst_qmetaobject::indexOfProperty_data()
} }
} }
void tst_qmetaobject::indexOfProperty() void tst_QMetaObject::indexOfProperty()
{ {
QFETCH(QByteArray, name); QFETCH(QByteArray, name);
const char *p = name.constData(); const char *p = name.constData();
@ -155,7 +144,7 @@ void tst_qmetaobject::indexOfProperty()
} }
} }
void tst_qmetaobject::indexOfMethod_data() void tst_QMetaObject::indexOfMethod_data()
{ {
QTest::addColumn<QByteArray>("method"); QTest::addColumn<QByteArray>("method");
const QMetaObject *mo = &QTreeView::staticMetaObject; const QMetaObject *mo = &QTreeView::staticMetaObject;
@ -166,7 +155,7 @@ void tst_qmetaobject::indexOfMethod_data()
} }
} }
void tst_qmetaobject::indexOfMethod() void tst_QMetaObject::indexOfMethod()
{ {
QFETCH(QByteArray, method); QFETCH(QByteArray, method);
const char *p = method.constData(); const char *p = method.constData();
@ -176,7 +165,7 @@ void tst_qmetaobject::indexOfMethod()
} }
} }
void tst_qmetaobject::indexOfSignal_data() void tst_QMetaObject::indexOfSignal_data()
{ {
QTest::addColumn<QByteArray>("signal"); QTest::addColumn<QByteArray>("signal");
const QMetaObject *mo = &QTreeView::staticMetaObject; const QMetaObject *mo = &QTreeView::staticMetaObject;
@ -189,7 +178,7 @@ void tst_qmetaobject::indexOfSignal_data()
} }
} }
void tst_qmetaobject::indexOfSignal() void tst_QMetaObject::indexOfSignal()
{ {
QFETCH(QByteArray, signal); QFETCH(QByteArray, signal);
const char *p = signal.constData(); const char *p = signal.constData();
@ -199,7 +188,7 @@ void tst_qmetaobject::indexOfSignal()
} }
} }
void tst_qmetaobject::indexOfSlot_data() void tst_QMetaObject::indexOfSlot_data()
{ {
QTest::addColumn<QByteArray>("slot"); QTest::addColumn<QByteArray>("slot");
const QMetaObject *mo = &QTreeView::staticMetaObject; const QMetaObject *mo = &QTreeView::staticMetaObject;
@ -212,7 +201,7 @@ void tst_qmetaobject::indexOfSlot_data()
} }
} }
void tst_qmetaobject::indexOfSlot() void tst_QMetaObject::indexOfSlot()
{ {
QFETCH(QByteArray, slot); QFETCH(QByteArray, slot);
const char *p = slot.constData(); const char *p = slot.constData();
@ -222,7 +211,7 @@ void tst_qmetaobject::indexOfSlot()
} }
} }
void tst_qmetaobject::unconnected_data() void tst_QMetaObject::unconnected_data()
{ {
QTest::addColumn<int>("signal_index"); QTest::addColumn<int>("signal_index");
QTest::newRow("signal--9") << 9; QTest::newRow("signal--9") << 9;
@ -233,7 +222,7 @@ void tst_qmetaobject::unconnected_data()
QTest::newRow("signal--70") << 70; QTest::newRow("signal--70") << 70;
} }
void tst_qmetaobject::unconnected() void tst_QMetaObject::unconnected()
{ {
LotsOfSignals *obj = new LotsOfSignals; LotsOfSignals *obj = new LotsOfSignals;
QFETCH(int, signal_index); QFETCH(int, signal_index);
@ -247,6 +236,6 @@ void tst_qmetaobject::unconnected()
delete obj; delete obj;
} }
QTEST_MAIN(tst_qmetaobject) QTEST_MAIN(tst_QMetaObject)
#include "main.moc" #include "tst_bench_qmetaobject.moc"

View File

@ -1,15 +1,10 @@
# Generated from qmetatype.pro.
##################################################################### #####################################################################
## tst_bench_qmetatype Binary: ## tst_bench_qmetatype Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qmetatype qt_internal_add_benchmark(tst_bench_qmetatype
SOURCES SOURCES
tst_qmetatype.cpp tst_bench_qmetatype.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qmetatype.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -321,4 +321,4 @@ void tst_QMetaType::constructInPlaceCopyStaticLess()
} }
QTEST_MAIN(tst_QMetaType) QTEST_MAIN(tst_QMetaType)
#include "tst_qmetatype.moc" #include "tst_bench_qmetatype.moc"

View File

@ -1,18 +1,13 @@
# Generated from qobject.pro.
##################################################################### #####################################################################
## tst_bench_qobject Binary: ## tst_bench_qobject Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qobject qt_internal_add_benchmark(tst_bench_qobject
SOURCES SOURCES
main.cpp tst_bench_qobject.cpp
object.cpp object.h object.cpp object.h
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Gui Qt::Gui
Qt::Test Qt::Test
Qt::Widgets Qt::Widgets
) )
#### Keys ignored in scope 1:.:.:qobject.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -37,7 +37,7 @@ enum {
SignalsAndSlotsBenchmarkConstant = 456789 SignalsAndSlotsBenchmarkConstant = 456789
}; };
class QObjectBenchmark : public QObject class tst_QObject : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -95,7 +95,7 @@ inline void allocator()
} }
} }
void QObjectBenchmark::stdAllocator() void tst_QObject::stdAllocator()
{ {
allocator<QObjectUsingStandardAllocator>(); allocator<QObjectUsingStandardAllocator>();
} }
@ -104,7 +104,7 @@ struct Functor {
void operator()(){} void operator()(){}
}; };
void QObjectBenchmark::signal_slot_benchmark_data() void tst_QObject::signal_slot_benchmark_data()
{ {
QTest::addColumn<int>("type"); QTest::addColumn<int>("type");
QTest::newRow("simple function") << 0; QTest::newRow("simple function") << 0;
@ -115,7 +115,7 @@ void QObjectBenchmark::signal_slot_benchmark_data()
QTest::newRow("functor") << 5; QTest::newRow("functor") << 5;
} }
void QObjectBenchmark::signal_slot_benchmark() void tst_QObject::signal_slot_benchmark()
{ {
QFETCH(int, type); QFETCH(int, type);
@ -176,7 +176,7 @@ void QObjectBenchmark::signal_slot_benchmark()
} }
} }
void QObjectBenchmark::signal_many_receivers_data() void tst_QObject::signal_many_receivers_data()
{ {
QTest::addColumn<int>("receiverCount"); QTest::addColumn<int>("receiverCount");
QTest::newRow("100 receivers") << 100; QTest::newRow("100 receivers") << 100;
@ -184,7 +184,7 @@ void QObjectBenchmark::signal_many_receivers_data()
QTest::newRow("10 000 receivers") << 10000; QTest::newRow("10 000 receivers") << 10000;
} }
void QObjectBenchmark::signal_many_receivers() void tst_QObject::signal_many_receivers()
{ {
QFETCH(int, receiverCount); QFETCH(int, receiverCount);
Object sender; Object sender;
@ -198,7 +198,7 @@ void QObjectBenchmark::signal_many_receivers()
} }
} }
void QObjectBenchmark::qproperty_benchmark_data() void tst_QObject::qproperty_benchmark_data()
{ {
QTest::addColumn<QByteArray>("name"); QTest::addColumn<QByteArray>("name");
const QMetaObject *mo = &QTreeView::staticMetaObject; const QMetaObject *mo = &QTreeView::staticMetaObject;
@ -209,7 +209,7 @@ void QObjectBenchmark::qproperty_benchmark_data()
} }
} }
void QObjectBenchmark::qproperty_benchmark() void tst_QObject::qproperty_benchmark()
{ {
QFETCH(QByteArray, name); QFETCH(QByteArray, name);
const char *p = name.constData(); const char *p = name.constData();
@ -221,7 +221,7 @@ void QObjectBenchmark::qproperty_benchmark()
} }
} }
void QObjectBenchmark::dynamic_property_benchmark() void tst_QObject::dynamic_property_benchmark()
{ {
QTreeView obj; QTreeView obj;
QBENCHMARK { QBENCHMARK {
@ -232,7 +232,7 @@ void QObjectBenchmark::dynamic_property_benchmark()
} }
} }
void QObjectBenchmark::connect_disconnect_benchmark_data() void tst_QObject::connect_disconnect_benchmark_data()
{ {
QTest::addColumn<int>("type"); QTest::addColumn<int>("type");
QTest::newRow("normalized signature") << 0; QTest::newRow("normalized signature") << 0;
@ -243,7 +243,7 @@ void QObjectBenchmark::connect_disconnect_benchmark_data()
QTest::newRow("function pointer/handle") << 5; QTest::newRow("function pointer/handle") << 5;
QTest::newRow("functor/handle") << 6;} QTest::newRow("functor/handle") << 6;}
void QObjectBenchmark::connect_disconnect_benchmark() void tst_QObject::connect_disconnect_benchmark()
{ {
QFETCH(int, type); QFETCH(int, type);
switch (type) { switch (type) {
@ -296,7 +296,7 @@ void QObjectBenchmark::connect_disconnect_benchmark()
} }
} }
void QObjectBenchmark::receiver_destroyed_benchmark() void tst_QObject::receiver_destroyed_benchmark()
{ {
Object sender; Object sender;
QBENCHMARK { QBENCHMARK {
@ -305,6 +305,6 @@ void QObjectBenchmark::receiver_destroyed_benchmark()
} }
} }
QTEST_MAIN(QObjectBenchmark) QTEST_MAIN(tst_QObject)
#include "main.moc" #include "tst_bench_qobject.moc"

View File

@ -1,6 +1,6 @@
qt_internal_add_benchmark(tst_bench_qproperty qt_internal_add_benchmark(tst_bench_qproperty
SOURCES SOURCES
main.cpp tst_bench_qproperty.cpp
propertytester.h propertytester.h
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Core Qt::Core

View File

@ -33,7 +33,7 @@
#include "propertytester.h" #include "propertytester.h"
class PropertyBenchmark : public QObject class tst_QProperty : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -53,7 +53,7 @@ private slots:
void cppNotifyingDirectReadOnce(); void cppNotifyingDirectReadOnce();
}; };
void PropertyBenchmark::cppOldBinding() void tst_QProperty::cppOldBinding()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
auto connection = connect(tester.data(), &PropertyTester::xOldChanged, auto connection = connect(tester.data(), &PropertyTester::xOldChanged,
@ -70,7 +70,7 @@ void PropertyBenchmark::cppOldBinding()
QObject::disconnect(connection); QObject::disconnect(connection);
} }
void PropertyBenchmark::cppOldBindingDirect() void tst_QProperty::cppOldBindingDirect()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
auto connection = connect(tester.data(), &PropertyTester::xOldChanged, auto connection = connect(tester.data(), &PropertyTester::xOldChanged,
@ -87,7 +87,7 @@ void PropertyBenchmark::cppOldBindingDirect()
QObject::disconnect(connection); QObject::disconnect(connection);
} }
void PropertyBenchmark::cppOldBindingReadOnce() void tst_QProperty::cppOldBindingReadOnce()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
auto connection = connect(tester.data(), &PropertyTester::xOldChanged, auto connection = connect(tester.data(), &PropertyTester::xOldChanged,
@ -103,7 +103,7 @@ void PropertyBenchmark::cppOldBindingReadOnce()
QObject::disconnect(connection); QObject::disconnect(connection);
} }
void PropertyBenchmark::cppOldBindingDirectReadOnce() void tst_QProperty::cppOldBindingDirectReadOnce()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
auto connection = connect(tester.data(), &PropertyTester::xOldChanged, auto connection = connect(tester.data(), &PropertyTester::xOldChanged,
@ -119,7 +119,7 @@ void PropertyBenchmark::cppOldBindingDirectReadOnce()
QObject::disconnect(connection); QObject::disconnect(connection);
} }
void PropertyBenchmark::cppNewBinding() void tst_QProperty::cppNewBinding()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->y.setBinding([&](){return tester->x.value();}); tester->y.setBinding([&](){return tester->x.value();});
@ -133,7 +133,7 @@ void PropertyBenchmark::cppNewBinding()
} }
} }
void PropertyBenchmark::cppNewBindingDirect() void tst_QProperty::cppNewBindingDirect()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->y.setBinding([&](){return tester->x.value();}); tester->y.setBinding([&](){return tester->x.value();});
@ -146,7 +146,7 @@ void PropertyBenchmark::cppNewBindingDirect()
} }
} }
void PropertyBenchmark::cppNewBindingReadOnce() void tst_QProperty::cppNewBindingReadOnce()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->y.setBinding([&](){return tester->x.value();}); tester->y.setBinding([&](){return tester->x.value();});
@ -160,7 +160,7 @@ void PropertyBenchmark::cppNewBindingReadOnce()
QCOMPARE(tester->property("y").toInt(), i); QCOMPARE(tester->property("y").toInt(), i);
} }
void PropertyBenchmark::cppNewBindingDirectReadOnce() void tst_QProperty::cppNewBindingDirectReadOnce()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->y.setBinding([&](){return tester->x.value();}); tester->y.setBinding([&](){return tester->x.value();});
@ -173,7 +173,7 @@ void PropertyBenchmark::cppNewBindingDirectReadOnce()
QCOMPARE(tester->y.value(), i); QCOMPARE(tester->y.value(), i);
} }
void PropertyBenchmark::cppNotifying() void tst_QProperty::cppNotifying()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->yNotified.setBinding([&](){return tester->xNotified.value();}); tester->yNotified.setBinding([&](){return tester->xNotified.value();});
@ -187,7 +187,7 @@ void PropertyBenchmark::cppNotifying()
} }
} }
void PropertyBenchmark::cppNotifyingDirect() void tst_QProperty::cppNotifyingDirect()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->yNotified.setBinding([&](){return tester->xNotified.value();}); tester->yNotified.setBinding([&](){return tester->xNotified.value();});
@ -200,7 +200,7 @@ void PropertyBenchmark::cppNotifyingDirect()
} }
} }
void PropertyBenchmark::cppNotifyingReadOnce() void tst_QProperty::cppNotifyingReadOnce()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->yNotified.setBinding([&](){return tester->xNotified.value();}); tester->yNotified.setBinding([&](){return tester->xNotified.value();});
@ -214,7 +214,7 @@ void PropertyBenchmark::cppNotifyingReadOnce()
QCOMPARE(tester->property("yNotified").toInt(), i); QCOMPARE(tester->property("yNotified").toInt(), i);
} }
void PropertyBenchmark::cppNotifyingDirectReadOnce() void tst_QProperty::cppNotifyingDirectReadOnce()
{ {
QScopedPointer<PropertyTester> tester {new PropertyTester}; QScopedPointer<PropertyTester> tester {new PropertyTester};
tester->yNotified.setBinding([&](){return tester->xNotified.value();}); tester->yNotified.setBinding([&](){return tester->xNotified.value();});
@ -227,5 +227,6 @@ void PropertyBenchmark::cppNotifyingDirectReadOnce()
QCOMPARE(tester->yNotified.value(), i); QCOMPARE(tester->yNotified.value(), i);
} }
QTEST_MAIN(PropertyBenchmark) QTEST_MAIN(tst_QProperty)
#include "main.moc"
#include "tst_bench_qproperty.moc"

View File

@ -1,12 +1,10 @@
# Generated from qvariant.pro.
##################################################################### #####################################################################
## tst_bench_qvariant Binary: ## tst_bench_qvariant Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qvariant qt_internal_add_benchmark(tst_bench_qvariant
SOURCES SOURCES
tst_qvariant.cpp tst_bench_qvariant.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Gui Qt::Gui
Qt::Test Qt::Test

View File

@ -34,7 +34,7 @@
#define ITERATION_COUNT 1e5 #define ITERATION_COUNT 1e5
class tst_qvariant : public QObject class tst_QVariant : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -107,7 +107,7 @@ Q_DECLARE_TYPEINFO(SmallClass, Q_RELOCATABLE_TYPE);
QT_END_NAMESPACE QT_END_NAMESPACE
Q_DECLARE_METATYPE(SmallClass); Q_DECLARE_METATYPE(SmallClass);
void tst_qvariant::testBound() void tst_QVariant::testBound()
{ {
qreal d = qreal(.5); qreal d = qreal(.5);
QBENCHMARK { QBENCHMARK {
@ -148,7 +148,7 @@ void variantCreation<SmallClass>(SmallClass val)
} }
template <> template <>
void variantCreation<tst_qvariant::ABenchmarkEnum>(tst_qvariant::ABenchmarkEnum val) void variantCreation<tst_QVariant::ABenchmarkEnum>(tst_QVariant::ABenchmarkEnum val)
{ {
QBENCHMARK { QBENCHMARK {
for (int i = 0; i < ITERATION_COUNT; ++i) { for (int i = 0; i < ITERATION_COUNT; ++i) {
@ -158,49 +158,49 @@ void variantCreation<tst_qvariant::ABenchmarkEnum>(tst_qvariant::ABenchmarkEnum
} }
void tst_qvariant::doubleVariantCreation() void tst_QVariant::doubleVariantCreation()
{ {
variantCreation<double>(0.0); variantCreation<double>(0.0);
} }
void tst_qvariant::floatVariantCreation() void tst_QVariant::floatVariantCreation()
{ {
variantCreation<float>(0.0f); variantCreation<float>(0.0f);
} }
void tst_qvariant::rectVariantCreation() void tst_QVariant::rectVariantCreation()
{ {
variantCreation<QRect>(QRect(1, 2, 3, 4)); variantCreation<QRect>(QRect(1, 2, 3, 4));
} }
void tst_qvariant::stringVariantCreation() void tst_QVariant::stringVariantCreation()
{ {
variantCreation<QString>(QString()); variantCreation<QString>(QString());
} }
#ifdef QT_GUI_LIB #ifdef QT_GUI_LIB
void tst_qvariant::pixmapVariantCreation() void tst_QVariant::pixmapVariantCreation()
{ {
variantCreation<QPixmap>(QPixmap()); variantCreation<QPixmap>(QPixmap());
} }
#endif #endif
void tst_qvariant::stringListVariantCreation() void tst_QVariant::stringListVariantCreation()
{ {
variantCreation<QStringList>(QStringList()); variantCreation<QStringList>(QStringList());
} }
void tst_qvariant::bigClassVariantCreation() void tst_QVariant::bigClassVariantCreation()
{ {
variantCreation<BigClass>(BigClass()); variantCreation<BigClass>(BigClass());
} }
void tst_qvariant::smallClassVariantCreation() void tst_QVariant::smallClassVariantCreation()
{ {
variantCreation<SmallClass>(SmallClass()); variantCreation<SmallClass>(SmallClass());
} }
void tst_qvariant::enumVariantCreation() void tst_QVariant::enumVariantCreation()
{ {
variantCreation<ABenchmarkEnum>(FirstEnumValue); variantCreation<ABenchmarkEnum>(FirstEnumValue);
} }
@ -217,42 +217,42 @@ static void variantSetValue(T d)
} }
} }
void tst_qvariant::doubleVariantSetValue() void tst_QVariant::doubleVariantSetValue()
{ {
variantSetValue<double>(0.0); variantSetValue<double>(0.0);
} }
void tst_qvariant::floatVariantSetValue() void tst_QVariant::floatVariantSetValue()
{ {
variantSetValue<float>(0.0f); variantSetValue<float>(0.0f);
} }
void tst_qvariant::rectVariantSetValue() void tst_QVariant::rectVariantSetValue()
{ {
variantSetValue<QRect>(QRect()); variantSetValue<QRect>(QRect());
} }
void tst_qvariant::stringVariantSetValue() void tst_QVariant::stringVariantSetValue()
{ {
variantSetValue<QString>(QString()); variantSetValue<QString>(QString());
} }
void tst_qvariant::stringListVariantSetValue() void tst_QVariant::stringListVariantSetValue()
{ {
variantSetValue<QStringList>(QStringList()); variantSetValue<QStringList>(QStringList());
} }
void tst_qvariant::bigClassVariantSetValue() void tst_QVariant::bigClassVariantSetValue()
{ {
variantSetValue<BigClass>(BigClass()); variantSetValue<BigClass>(BigClass());
} }
void tst_qvariant::smallClassVariantSetValue() void tst_QVariant::smallClassVariantSetValue()
{ {
variantSetValue<SmallClass>(SmallClass()); variantSetValue<SmallClass>(SmallClass());
} }
void tst_qvariant::enumVariantSetValue() void tst_QVariant::enumVariantSetValue()
{ {
variantSetValue<ABenchmarkEnum>(FirstEnumValue); variantSetValue<ABenchmarkEnum>(FirstEnumValue);
} }
@ -268,32 +268,32 @@ static void variantAssignment(T d)
} }
} }
void tst_qvariant::doubleVariantAssignment() void tst_QVariant::doubleVariantAssignment()
{ {
variantAssignment<double>(0.0); variantAssignment<double>(0.0);
} }
void tst_qvariant::floatVariantAssignment() void tst_QVariant::floatVariantAssignment()
{ {
variantAssignment<float>(0.0f); variantAssignment<float>(0.0f);
} }
void tst_qvariant::rectVariantAssignment() void tst_QVariant::rectVariantAssignment()
{ {
variantAssignment<QRect>(QRect()); variantAssignment<QRect>(QRect());
} }
void tst_qvariant::stringVariantAssignment() void tst_QVariant::stringVariantAssignment()
{ {
variantAssignment<QString>(QString()); variantAssignment<QString>(QString());
} }
void tst_qvariant::stringListVariantAssignment() void tst_QVariant::stringListVariantAssignment()
{ {
variantAssignment<QStringList>(QStringList()); variantAssignment<QStringList>(QStringList());
} }
void tst_qvariant::doubleVariantValue() void tst_QVariant::doubleVariantValue()
{ {
QVariant v(0.0); QVariant v(0.0);
QBENCHMARK { QBENCHMARK {
@ -303,7 +303,7 @@ void tst_qvariant::doubleVariantValue()
} }
} }
void tst_qvariant::floatVariantValue() void tst_QVariant::floatVariantValue()
{ {
QVariant v(0.0f); QVariant v(0.0f);
QBENCHMARK { QBENCHMARK {
@ -313,7 +313,7 @@ void tst_qvariant::floatVariantValue()
} }
} }
void tst_qvariant::rectVariantValue() void tst_QVariant::rectVariantValue()
{ {
QVariant v(QRect(1,2,3,4)); QVariant v(QRect(1,2,3,4));
QBENCHMARK { QBENCHMARK {
@ -323,7 +323,7 @@ void tst_qvariant::rectVariantValue()
} }
} }
void tst_qvariant::stringVariantValue() void tst_QVariant::stringVariantValue()
{ {
QVariant v = QString(); QVariant v = QString();
QBENCHMARK { QBENCHMARK {
@ -333,7 +333,7 @@ void tst_qvariant::stringVariantValue()
} }
} }
void tst_qvariant::createCoreType_data() void tst_QVariant::createCoreType_data()
{ {
QTest::addColumn<int>("typeId"); QTest::addColumn<int>("typeId");
for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i) { for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i) {
@ -346,7 +346,7 @@ void tst_qvariant::createCoreType_data()
// QVariant. The purpose of this benchmark is to measure the overhead // QVariant. The purpose of this benchmark is to measure the overhead
// of creating (and destroying) a QVariant compared to creating the // of creating (and destroying) a QVariant compared to creating the
// type directly. // type directly.
void tst_qvariant::createCoreType() void tst_QVariant::createCoreType()
{ {
QFETCH(int, typeId); QFETCH(int, typeId);
QBENCHMARK { QBENCHMARK {
@ -355,7 +355,7 @@ void tst_qvariant::createCoreType()
} }
} }
void tst_qvariant::createCoreTypeCopy_data() void tst_QVariant::createCoreTypeCopy_data()
{ {
createCoreType_data(); createCoreType_data();
} }
@ -364,7 +364,7 @@ void tst_qvariant::createCoreTypeCopy_data()
// QVariant. The purpose of this benchmark is to measure the overhead // QVariant. The purpose of this benchmark is to measure the overhead
// of creating (and destroying) a QVariant compared to creating the // of creating (and destroying) a QVariant compared to creating the
// type directly. // type directly.
void tst_qvariant::createCoreTypeCopy() void tst_QVariant::createCoreTypeCopy()
{ {
QFETCH(int, typeId); QFETCH(int, typeId);
QMetaType metaType(typeId); QMetaType metaType(typeId);
@ -376,6 +376,6 @@ void tst_qvariant::createCoreTypeCopy()
} }
} }
QTEST_MAIN(tst_qvariant) QTEST_MAIN(tst_QVariant)
#include "tst_qvariant.moc" #include "tst_bench_qvariant.moc"

View File

@ -1,15 +1,10 @@
# Generated from qwineventnotifier.pro.
##################################################################### #####################################################################
## tst_bench_qwineventnotifier Binary: ## tst_bench_qwineventnotifier Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qwineventnotifier qt_internal_add_benchmark(tst_bench_qwineventnotifier
SOURCES SOURCES
main.cpp tst_bench_qwineventnotifier.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qwineventnotifier.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -34,7 +34,7 @@
#include <QtCore/qelapsedtimer.h> #include <QtCore/qelapsedtimer.h>
#include <QtCore/qt_windows.h> #include <QtCore/qt_windows.h>
class QWinEventNotifierBenchmark : public QObject class tst_QWinEventNotifier : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -102,7 +102,7 @@ protected:
int numberOfIterations; int numberOfIterations;
}; };
void QWinEventNotifierBenchmark::waves_data() void tst_QWinEventNotifier::waves_data()
{ {
QTest::addColumn<int>("waves"); QTest::addColumn<int>("waves");
QTest::addColumn<int>("notifiers"); QTest::addColumn<int>("notifiers");
@ -112,7 +112,7 @@ void QWinEventNotifierBenchmark::waves_data()
} }
} }
void QWinEventNotifierBenchmark::waves() void tst_QWinEventNotifier::waves()
{ {
QFETCH(int, waves); QFETCH(int, waves);
QFETCH(int, notifiers); QFETCH(int, notifiers);
@ -131,6 +131,6 @@ void QWinEventNotifierBenchmark::waves()
emit factory.stop(); emit factory.stop();
} }
QTEST_MAIN(QWinEventNotifierBenchmark) QTEST_MAIN(tst_QWinEventNotifier)
#include "main.moc" #include "tst_bench_qwineventnotifier.moc"

View File

@ -1,12 +1,10 @@
# Generated from qmimedatabase.pro.
##################################################################### #####################################################################
## tst_bench_qmimedatabase Binary: ## tst_bench_qmimedatabase Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qmimedatabase qt_internal_add_benchmark(tst_bench_qmimedatabase
SOURCES SOURCES
main.cpp tst_bench_qmimedatabase.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -83,4 +83,5 @@ void tst_QMimeDatabase::benchMimeTypeForName()
} }
QTEST_MAIN(tst_QMimeDatabase) QTEST_MAIN(tst_QMimeDatabase)
#include "main.moc"
#include "tst_bench_qmimedatabase.moc"

View File

@ -1,15 +1,10 @@
# Generated from quuid.pro.
##################################################################### #####################################################################
## tst_bench_quuid Binary: ## tst_bench_quuid Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_quuid qt_internal_add_benchmark(tst_bench_quuid
SOURCES SOURCES
tst_quuid.cpp tst_bench_quuid.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:quuid.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -30,14 +30,10 @@
#include <QtCore/QUuid> #include <QtCore/QUuid>
#include <QTest> #include <QTest>
class tst_bench_QUuid : public QObject class tst_QUuid : public QObject
{ {
Q_OBJECT Q_OBJECT
public:
tst_bench_QUuid()
{ }
private slots: private slots:
void createUuid(); void createUuid();
void fromChar(); void fromChar();
@ -56,21 +52,21 @@ private slots:
void operatorMore(); void operatorMore();
}; };
void tst_bench_QUuid::createUuid() void tst_QUuid::createUuid()
{ {
QBENCHMARK { QBENCHMARK {
QUuid::createUuid(); QUuid::createUuid();
} }
} }
void tst_bench_QUuid::fromChar() void tst_QUuid::fromChar()
{ {
QBENCHMARK { QBENCHMARK {
QUuid uuid("{67C8770B-44F1-410A-AB9A-F9B5446F13EE}"); QUuid uuid("{67C8770B-44F1-410A-AB9A-F9B5446F13EE}");
} }
} }
void tst_bench_QUuid::toString() void tst_QUuid::toString()
{ {
QUuid uuid = QUuid::createUuid(); QUuid uuid = QUuid::createUuid();
QBENCHMARK { QBENCHMARK {
@ -78,7 +74,7 @@ void tst_bench_QUuid::toString()
} }
} }
void tst_bench_QUuid::fromString() void tst_QUuid::fromString()
{ {
QString string = "{67C8770B-44F1-410A-AB9A-F9B5446F13EE}"; QString string = "{67C8770B-44F1-410A-AB9A-F9B5446F13EE}";
QBENCHMARK { QBENCHMARK {
@ -86,7 +82,7 @@ void tst_bench_QUuid::fromString()
} }
} }
void tst_bench_QUuid::toByteArray() void tst_QUuid::toByteArray()
{ {
QUuid uuid = QUuid::createUuid(); QUuid uuid = QUuid::createUuid();
QBENCHMARK { QBENCHMARK {
@ -94,7 +90,7 @@ void tst_bench_QUuid::toByteArray()
} }
} }
void tst_bench_QUuid::fromByteArray() void tst_QUuid::fromByteArray()
{ {
QByteArray string = "{67C8770B-44F1-410A-AB9A-F9B5446F13EE}"; QByteArray string = "{67C8770B-44F1-410A-AB9A-F9B5446F13EE}";
QBENCHMARK { QBENCHMARK {
@ -102,7 +98,7 @@ void tst_bench_QUuid::fromByteArray()
} }
} }
void tst_bench_QUuid::toRfc4122() void tst_QUuid::toRfc4122()
{ {
QUuid uuid = QUuid::createUuid(); QUuid uuid = QUuid::createUuid();
QBENCHMARK { QBENCHMARK {
@ -110,7 +106,7 @@ void tst_bench_QUuid::toRfc4122()
} }
} }
void tst_bench_QUuid::fromRfc4122() void tst_QUuid::fromRfc4122()
{ {
QByteArray string = QByteArray::fromHex("67C8770B44F1410AAB9AF9B5446F13EE"); QByteArray string = QByteArray::fromHex("67C8770B44F1410AAB9AF9B5446F13EE");
QBENCHMARK { QBENCHMARK {
@ -119,7 +115,7 @@ void tst_bench_QUuid::fromRfc4122()
} }
} }
void tst_bench_QUuid::createUuidV3() void tst_QUuid::createUuidV3()
{ {
QUuid ns = QUuid::createUuid(); QUuid ns = QUuid::createUuid();
QByteArray name = QByteArray("Test"); QByteArray name = QByteArray("Test");
@ -129,7 +125,7 @@ void tst_bench_QUuid::createUuidV3()
} }
} }
void tst_bench_QUuid::createUuidV5() void tst_QUuid::createUuidV5()
{ {
QUuid ns = QUuid::createUuid(); QUuid ns = QUuid::createUuid();
QByteArray name = QByteArray("Test"); QByteArray name = QByteArray("Test");
@ -139,7 +135,7 @@ void tst_bench_QUuid::createUuidV5()
} }
} }
void tst_bench_QUuid::toDataStream() void tst_QUuid::toDataStream()
{ {
QUuid uuid = QUuid::createUuid(); QUuid uuid = QUuid::createUuid();
QByteArray ar; QByteArray ar;
@ -151,7 +147,7 @@ void tst_bench_QUuid::toDataStream()
} }
} }
void tst_bench_QUuid::fromDataStream() void tst_QUuid::fromDataStream()
{ {
QUuid uuid1, uuid2; QUuid uuid1, uuid2;
uuid1 = QUuid::createUuid(); uuid1 = QUuid::createUuid();
@ -168,7 +164,7 @@ void tst_bench_QUuid::fromDataStream()
} }
} }
void tst_bench_QUuid::isNull() void tst_QUuid::isNull()
{ {
QUuid uuid = QUuid(); QUuid uuid = QUuid();
QBENCHMARK { QBENCHMARK {
@ -176,7 +172,7 @@ void tst_bench_QUuid::isNull()
} }
} }
void tst_bench_QUuid::operatorLess() void tst_QUuid::operatorLess()
{ {
QUuid uuid1, uuid2; QUuid uuid1, uuid2;
uuid1 = QUuid::createUuid(); uuid1 = QUuid::createUuid();
@ -186,7 +182,7 @@ void tst_bench_QUuid::operatorLess()
} }
} }
void tst_bench_QUuid::operatorMore() void tst_QUuid::operatorMore()
{ {
QUuid uuid1, uuid2; QUuid uuid1, uuid2;
uuid1 = QUuid::createUuid(); uuid1 = QUuid::createUuid();
@ -196,5 +192,6 @@ void tst_bench_QUuid::operatorMore()
} }
} }
QTEST_MAIN(tst_bench_QUuid); QTEST_MAIN(tst_QUuid)
#include "tst_quuid.moc"
#include "tst_bench_quuid.moc"

View File

@ -1,16 +1,10 @@
# Generated from qbytearray.pro.
##################################################################### #####################################################################
## tst_bench_qbytearray Binary: ## tst_bench_qbytearray Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qbytearray qt_internal_add_benchmark(tst_bench_qbytearray
SOURCES SOURCES
main.cpp tst_bench_qbytearray.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qbytearray.pro:<TRUE>:
# TEMPLATE = "app"
# TESTDATA = "main.cpp"

View File

@ -34,8 +34,7 @@
#include <qtest.h> #include <qtest.h>
#include <limits> #include <limits>
class tst_QByteArray : public QObject
class tst_qbytearray : public QObject
{ {
Q_OBJECT Q_OBJECT
QByteArray sourcecode; QByteArray sourcecode;
@ -59,14 +58,14 @@ private slots:
void toPercentEncoding(); void toPercentEncoding();
}; };
void tst_qbytearray::initTestCase() void tst_QByteArray::initTestCase()
{ {
QFile self(QFINDTESTDATA("main.cpp")); QFile self(QFINDTESTDATA("tst_bench_qbytearray.cpp"));
QVERIFY(self.open(QIODevice::ReadOnly)); QVERIFY(self.open(QIODevice::ReadOnly));
sourcecode = self.readAll(); sourcecode = self.readAll();
} }
void tst_qbytearray::append_data() void tst_QByteArray::append_data()
{ {
QTest::addColumn<int>("size"); QTest::addColumn<int>("size");
QTest::newRow("1") << int(1); QTest::newRow("1") << int(1);
@ -80,7 +79,7 @@ void tst_qbytearray::append_data()
QTest::newRow("100000000") << int(100000000); QTest::newRow("100000000") << int(100000000);
} }
void tst_qbytearray::append() void tst_QByteArray::append()
{ {
QFETCH(int, size); QFETCH(int, size);
@ -106,7 +105,7 @@ static QByteArray decNext(QByteArray &&big)
return big; return big;
} }
void tst_qbytearray::toLongLong_data() void tst_QByteArray::toLongLong_data()
{ {
QTest::addColumn<QByteArray>("text"); QTest::addColumn<QByteArray>("text");
QTest::addColumn<bool>("good"); QTest::addColumn<bool>("good");
@ -127,7 +126,7 @@ void tst_qbytearray::toLongLong_data()
QTest::newRow("max+1") << decNext(QByteArray::number(LL::max())) << false << 0LL; QTest::newRow("max+1") << decNext(QByteArray::number(LL::max())) << false << 0LL;
} }
void tst_qbytearray::toLongLong() void tst_QByteArray::toLongLong()
{ {
QFETCH(QByteArray, text); QFETCH(QByteArray, text);
QFETCH(bool, good); QFETCH(bool, good);
@ -142,7 +141,7 @@ void tst_qbytearray::toLongLong()
QCOMPARE(ok, good); QCOMPARE(ok, good);
} }
void tst_qbytearray::toULongLong_data() void tst_QByteArray::toULongLong_data()
{ {
QTest::addColumn<QByteArray>("text"); QTest::addColumn<QByteArray>("text");
QTest::addColumn<bool>("good"); QTest::addColumn<bool>("good");
@ -160,7 +159,7 @@ void tst_qbytearray::toULongLong_data()
QTest::newRow("max+1") << decNext(QByteArray::number(ULL::max())) << false << 0ULL; QTest::newRow("max+1") << decNext(QByteArray::number(ULL::max())) << false << 0ULL;
} }
void tst_qbytearray::toULongLong() void tst_QByteArray::toULongLong()
{ {
QFETCH(QByteArray, text); QFETCH(QByteArray, text);
QFETCH(bool, good); QFETCH(bool, good);
@ -175,7 +174,7 @@ void tst_qbytearray::toULongLong()
QCOMPARE(ok, good); QCOMPARE(ok, good);
} }
void tst_qbytearray::latin1Uppercasing_qt54() void tst_QByteArray::latin1Uppercasing_qt54()
{ {
QByteArray s = sourcecode; QByteArray s = sourcecode;
s.detach(); s.detach();
@ -224,7 +223,7 @@ static const uchar uppercased[256] = {
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,
0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xf7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xff 0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xf7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xff
}; };
void tst_qbytearray::latin1Uppercasing_xlate() void tst_QByteArray::latin1Uppercasing_xlate()
{ {
QByteArray output = sourcecode; QByteArray output = sourcecode;
output.detach(); output.detach();
@ -238,7 +237,7 @@ void tst_qbytearray::latin1Uppercasing_xlate()
} }
} }
void tst_qbytearray::latin1Uppercasing_xlate_checked() void tst_QByteArray::latin1Uppercasing_xlate_checked()
{ {
QByteArray output = sourcecode; QByteArray output = sourcecode;
output.detach(); output.detach();
@ -291,7 +290,7 @@ static const char categories[256] = {
2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,0 2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,0
}; };
void tst_qbytearray::latin1Uppercasing_category() void tst_QByteArray::latin1Uppercasing_category()
{ {
QByteArray output = sourcecode; QByteArray output = sourcecode;
output.detach(); output.detach();
@ -336,7 +335,7 @@ static bool bittest(const quint32 *data, uchar bit)
return data[bit / bitsperelem] & (1 << (bit & (bitsperelem - 1))); return data[bit / bitsperelem] & (1 << (bit & (bitsperelem - 1)));
} }
void tst_qbytearray::latin1Uppercasing_bitcheck() void tst_QByteArray::latin1Uppercasing_bitcheck()
{ {
QByteArray output = sourcecode; QByteArray output = sourcecode;
output.detach(); output.detach();
@ -350,7 +349,7 @@ void tst_qbytearray::latin1Uppercasing_bitcheck()
} }
} }
void tst_qbytearray::toPercentEncoding_data() void tst_QByteArray::toPercentEncoding_data()
{ {
QTest::addColumn<QByteArray>("plaintext"); QTest::addColumn<QByteArray>("plaintext");
QTest::addColumn<QByteArray>("expected"); QTest::addColumn<QByteArray>("expected");
@ -369,7 +368,7 @@ void tst_qbytearray::toPercentEncoding_data()
"%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D%7F"); "%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D%7F");
} }
void tst_qbytearray::toPercentEncoding() void tst_QByteArray::toPercentEncoding()
{ {
QFETCH(QByteArray, plaintext); QFETCH(QByteArray, plaintext);
QByteArray encoded; QByteArray encoded;
@ -379,6 +378,6 @@ void tst_qbytearray::toPercentEncoding()
QTEST(encoded, "expected"); QTEST(encoded, "expected");
} }
QTEST_MAIN(tst_qbytearray) QTEST_MAIN(tst_QByteArray)
#include "main.moc" #include "tst_bench_qbytearray.moc"

View File

@ -1,12 +1,10 @@
# Generated from qchar.pro.
##################################################################### #####################################################################
## tst_bench_qchar Binary: ## tst_bench_qchar Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qchar qt_internal_add_benchmark(tst_bench_qchar
SOURCES SOURCES
main.cpp tst_bench_qchar.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -133,4 +133,4 @@ void tst_QChar::isSpace()
QTEST_MAIN(tst_QChar) QTEST_MAIN(tst_QChar)
#include "main.moc" #include "tst_bench_qchar.moc"

View File

@ -1,12 +1,10 @@
# Generated from qlocale.pro.
##################################################################### #####################################################################
## tst_bench_qlocale Binary: ## tst_bench_qlocale Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qlocale qt_internal_add_benchmark(tst_bench_qlocale
SOURCES SOURCES
main.cpp tst_bench_qlocale.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -394,4 +394,4 @@ void tst_QLocale::number_QString()
QTEST_MAIN(tst_QLocale) QTEST_MAIN(tst_QLocale)
#include "main.moc" #include "tst_bench_qlocale.moc"

View File

@ -1,18 +1,12 @@
# Generated from qstringbuilder.pro.
##################################################################### #####################################################################
## tst_bench_qstringbuilder Binary: ## tst_bench_qstringbuilder Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qstringbuilder qt_internal_add_benchmark(tst_bench_qstringbuilder
SOURCES SOURCES
main.cpp tst_bench_qstringbuilder.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
COMPILE_OPTIONS COMPILE_OPTIONS
-g -g
) )
#### Keys ignored in scope 1:.:.:qstringbuilder.pro:<TRUE>:
# QMAKE_CFLAGS = "-g"
# TEMPLATE = "app"

View File

@ -96,12 +96,12 @@
#define LITERAL "some string literal" #define LITERAL "some string literal"
class tst_qstringbuilder : public QObject class tst_QStringBuilder : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
tst_qstringbuilder() tst_QStringBuilder()
: l1literal(LITERAL), : l1literal(LITERAL),
l1string(LITERAL), l1string(LITERAL),
ba(LITERAL), ba(LITERAL),
@ -408,8 +408,8 @@ private:
std::string stdr; std::string stdr;
}; };
QTEST_MAIN(tst_qstringbuilder)
#undef P #undef P
#include "main.moc" QTEST_MAIN(tst_QStringBuilder)
#include "tst_bench_qstringbuilder.moc"

View File

@ -1,12 +1,10 @@
# Generated from qstringlist.pro.
##################################################################### #####################################################################
## tst_bench_qstringlist Binary: ## tst_bench_qstringlist Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qstringlist qt_internal_add_benchmark(tst_bench_qstringlist
SOURCES SOURCES
main.cpp tst_bench_qstringlist.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -237,4 +237,4 @@ void tst_QStringList::split_stdlist_stdstring() const
QTEST_MAIN(tst_QStringList) QTEST_MAIN(tst_QStringList)
#include "main.moc" #include "tst_bench_qstringlist.moc"

View File

@ -4,7 +4,7 @@
qt_internal_add_benchmark(tst_bench_qstringtokenizer qt_internal_add_benchmark(tst_bench_qstringtokenizer
SOURCES SOURCES
main.cpp tst_bench_qstringtokenizer.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -142,4 +142,4 @@ void tst_QStringTokenizer::tokenize() const
QTEST_MAIN(tst_QStringTokenizer) QTEST_MAIN(tst_QStringTokenizer)
#include "main.moc" #include "tst_bench_qstringtokenizer.moc"

View File

@ -5,7 +5,7 @@
qt_internal_add_benchmark(tst_bench_qfuture qt_internal_add_benchmark(tst_bench_qfuture
EXCEPTIONS EXCEPTIONS
SOURCES SOURCES
tst_qfuture.cpp tst_bench_qfuture.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -317,4 +317,5 @@ void tst_QFuture::progressText()
} }
QTEST_MAIN(tst_QFuture) QTEST_MAIN(tst_QFuture)
#include "tst_qfuture.moc"
#include "tst_bench_qfuture.moc"

View File

@ -1,16 +1,11 @@
# Generated from qmutex.pro.
##################################################################### #####################################################################
## tst_bench_qmutex Binary: ## tst_bench_qmutex Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qmutex qt_internal_add_benchmark(tst_bench_qmutex
SOURCES SOURCES
tst_qmutex.cpp tst_bench_qmutex.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::CorePrivate Qt::CorePrivate
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qmutex.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -450,4 +450,5 @@ void tst_QMutex::contendedQMutexLocker()
} }
QTEST_MAIN(tst_QMutex) QTEST_MAIN(tst_QMutex)
#include "tst_qmutex.moc"
#include "tst_bench_qmutex.moc"

View File

@ -1,16 +1,11 @@
# Generated from qreadwritelock.pro.
##################################################################### #####################################################################
## tst_bench_qreadwritelock Binary: ## tst_bench_qreadwritelock Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qreadwritelock qt_internal_add_benchmark(tst_bench_qreadwritelock
SOURCES SOURCES
tst_qreadwritelock.cpp tst_bench_qreadwritelock.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::CorePrivate Qt::CorePrivate
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qreadwritelock.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -256,4 +256,4 @@ void tst_QReadWriteLock::writeOnly()
} }
QTEST_MAIN(tst_QReadWriteLock) QTEST_MAIN(tst_QReadWriteLock)
#include "tst_qreadwritelock.moc" #include "tst_bench_qreadwritelock.moc"

View File

@ -1,15 +1,10 @@
# Generated from qthreadpool.pro.
##################################################################### #####################################################################
## tst_bench_qthreadpool Binary: ## tst_bench_qthreadpool Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qthreadpool qt_internal_add_benchmark(tst_bench_qthreadpool
SOURCES SOURCES
tst_qthreadpool.cpp tst_bench_qthreadpool.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qthreadpool.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -76,4 +76,5 @@ void tst_QThreadPool::activeThreadCount()
} }
QTEST_MAIN(tst_QThreadPool) QTEST_MAIN(tst_QThreadPool)
#include "tst_qthreadpool.moc"
#include "tst_bench_qthreadpool.moc"

View File

@ -1,15 +1,10 @@
# Generated from qthreadstorage.pro.
##################################################################### #####################################################################
## tst_bench_qthreadstorage Binary: ## tst_bench_qthreadstorage Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qthreadstorage qt_internal_add_benchmark(tst_bench_qthreadstorage
SOURCES SOURCES
tst_qthreadstorage.cpp tst_bench_qthreadstorage.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qthreadstorage.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -104,6 +104,6 @@ void tst_QThreadStorage::set()
ts.setLocalData(0); ts.setLocalData(0);
} }
QTEST_MAIN(tst_QThreadStorage) QTEST_MAIN(tst_QThreadStorage)
#include "tst_qthreadstorage.moc"
#include "tst_bench_qthreadstorage.moc"

View File

@ -1,15 +1,10 @@
# Generated from qwaitcondition.pro.
##################################################################### #####################################################################
## tst_bench_qwaitcondition Binary: ## tst_bench_qwaitcondition Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qwaitcondition qt_internal_add_benchmark(tst_bench_qwaitcondition
SOURCES SOURCES
tst_qwaitcondition.cpp tst_bench_qwaitcondition.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qwaitcondition.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -124,6 +124,6 @@ void tst_QWaitCondition::oscillate_writelock()
oscillate<QReadWriteLock, QWriteLocker>(timeout); oscillate<QReadWriteLock, QWriteLocker>(timeout);
} }
QTEST_MAIN(tst_QWaitCondition) QTEST_MAIN(tst_QWaitCondition)
#include "tst_qwaitcondition.moc"
#include "tst_bench_qwaitcondition.moc"

View File

@ -1,12 +1,10 @@
# Generated from qdatetime.pro.
##################################################################### #####################################################################
## tst_bench_qdatetime Binary: ## tst_bench_qdatetime Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qdatetime qt_internal_add_benchmark(tst_bench_qdatetime
SOURCES SOURCES
main.cpp tst_bench_qdatetime.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -571,4 +571,4 @@ void tst_QDateTime::fromMSecsSinceEpochTz()
QTEST_MAIN(tst_QDateTime) QTEST_MAIN(tst_QDateTime)
#include "main.moc" #include "tst_bench_qdatetime.moc"

View File

@ -1,12 +1,10 @@
# Generated from qtimezone.pro.
##################################################################### #####################################################################
## tst_bench_qtimezone Binary: ## tst_bench_qtimezone Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qtimezone qt_internal_add_benchmark(tst_bench_qtimezone
SOURCES SOURCES
main.cpp tst_bench_qtimezone.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -163,4 +163,4 @@ void tst_QTimeZone::transitionsReverse()
QTEST_MAIN(tst_QTimeZone) QTEST_MAIN(tst_QTimeZone)
#include "main.moc" #include "tst_bench_qtimezone.moc"

View File

@ -1,13 +1,13 @@
# Generated from tools.pro.
add_subdirectory(containers-associative) add_subdirectory(containers-associative)
add_subdirectory(containers-sequential) add_subdirectory(containers-sequential)
add_subdirectory(qcontiguouscache) add_subdirectory(qcontiguouscache)
add_subdirectory(qcryptographichash) add_subdirectory(qcryptographichash)
add_subdirectory(qhash)
add_subdirectory(qlist) add_subdirectory(qlist)
add_subdirectory(qmap) add_subdirectory(qmap)
add_subdirectory(qrect) add_subdirectory(qrect)
add_subdirectory(qringbuffer) add_subdirectory(qringbuffer)
add_subdirectory(qset)
add_subdirectory(qsharedpointer) add_subdirectory(qsharedpointer)
add_subdirectory(qstack) add_subdirectory(qstack)
add_subdirectory(qvector) add_subdirectory(qvector)

View File

@ -1,15 +1,10 @@
# Generated from containers-associative.pro.
##################################################################### #####################################################################
## tst_bench_containers-associative Binary: ## tst_bench_containers_associative Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_containers-associative qt_internal_add_benchmark(tst_bench_containers_associative
SOURCES SOURCES
main.cpp tst_bench_containers_associative.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:containers-associative.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -127,4 +127,5 @@ void tst_associative_containers::lookup()
} }
QTEST_MAIN(tst_associative_containers) QTEST_MAIN(tst_associative_containers)
#include "main.moc"
#include "tst_bench_containers_associative.moc"

View File

@ -1,15 +1,10 @@
# Generated from containers-sequential.pro.
##################################################################### #####################################################################
## tst_bench_containers-sequential Binary: ## tst_bench_containers-sequential Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_containers-sequential qt_internal_add_benchmark(tst_bench_containers_sequential
SOURCES SOURCES
main.cpp tst_bench_containers_sequential.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:containers-sequential.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -244,4 +244,5 @@ void tst_vector_vs_std::lookup_Large()
} }
QTEST_MAIN(tst_vector_vs_std) QTEST_MAIN(tst_vector_vs_std)
#include "main.moc"
#include "tst_bench_containers_sequential.moc"

View File

@ -1,12 +1,10 @@
# Generated from qcontiguouscache.pro.
##################################################################### #####################################################################
## tst_bench_qcontiguouscache Binary: ## tst_bench_qcontiguouscache Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qcontiguouscache qt_internal_add_benchmark(tst_bench_qcontiguouscache
SOURCES SOURCES
main.cpp tst_bench_qcontiguouscache.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -46,8 +46,6 @@ private slots:
void contiguousCacheBenchmark(); void contiguousCacheBenchmark();
}; };
QTEST_MAIN(tst_QContiguousCache)
void tst_QContiguousCache::asScrollingList() void tst_QContiguousCache::asScrollingList()
{ {
int i; int i;
@ -176,4 +174,6 @@ void tst_QContiguousCache::contiguousCacheBenchmark()
} }
} }
#include "main.moc" QTEST_MAIN(tst_QContiguousCache)
#include "tst_bench_qcontiguouscache.moc"

View File

@ -1,12 +1,10 @@
# Generated from qcryptographichash.pro.
##################################################################### #####################################################################
## tst_bench_qcryptographichash Binary: ## tst_bench_qcryptographichash Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qcryptographichash qt_internal_add_benchmark(tst_bench_qcryptographichash
SOURCES SOURCES
main.cpp tst_bench_qcryptographichash.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -35,13 +35,13 @@
#include <time.h> #include <time.h>
class tst_bench_QCryptographicHash : public QObject class tst_QCryptographicHash : public QObject
{ {
Q_OBJECT Q_OBJECT
QByteArray blockOfData; QByteArray blockOfData;
public: public:
tst_bench_QCryptographicHash(); tst_QCryptographicHash();
private Q_SLOTS: private Q_SLOTS:
void hash_data(); void hash_data();
@ -109,7 +109,7 @@ const char *algoname(int i)
return nullptr; return nullptr;
} }
tst_bench_QCryptographicHash::tst_bench_QCryptographicHash() tst_QCryptographicHash::tst_QCryptographicHash()
: blockOfData(MaxBlockSize, Qt::Uninitialized) : blockOfData(MaxBlockSize, Qt::Uninitialized)
{ {
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
@ -124,7 +124,7 @@ tst_bench_QCryptographicHash::tst_bench_QCryptographicHash()
} }
} }
void tst_bench_QCryptographicHash::hash_data() void tst_QCryptographicHash::hash_data()
{ {
QTest::addColumn<int>("algorithm"); QTest::addColumn<int>("algorithm");
QTest::addColumn<QByteArray>("data"); QTest::addColumn<QByteArray>("data");
@ -139,7 +139,7 @@ void tst_bench_QCryptographicHash::hash_data()
} }
} }
void tst_bench_QCryptographicHash::hash() void tst_QCryptographicHash::hash()
{ {
QFETCH(int, algorithm); QFETCH(int, algorithm);
QFETCH(QByteArray, data); QFETCH(QByteArray, data);
@ -150,7 +150,7 @@ void tst_bench_QCryptographicHash::hash()
} }
} }
void tst_bench_QCryptographicHash::addData() void tst_QCryptographicHash::addData()
{ {
QFETCH(int, algorithm); QFETCH(int, algorithm);
QFETCH(QByteArray, data); QFETCH(QByteArray, data);
@ -164,7 +164,7 @@ void tst_bench_QCryptographicHash::addData()
} }
} }
void tst_bench_QCryptographicHash::addDataChunked() void tst_QCryptographicHash::addDataChunked()
{ {
QFETCH(int, algorithm); QFETCH(int, algorithm);
QFETCH(QByteArray, data); QFETCH(QByteArray, data);
@ -183,6 +183,6 @@ void tst_bench_QCryptographicHash::addDataChunked()
} }
} }
QTEST_APPLESS_MAIN(tst_bench_QCryptographicHash) QTEST_APPLESS_MAIN(tst_QCryptographicHash)
#include "main.moc" #include "tst_bench_qcryptographichash.moc"

View File

@ -1,12 +1,10 @@
# Generated from qhash.pro.
##################################################################### #####################################################################
## tst_hash Binary: ## tst_bench_qhash Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_hash qt_internal_add_benchmark(tst_bench_qhash
SOURCES SOURCES
main.cpp tst_bench_qhash.cpp
outofline.cpp outofline.cpp
INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES
. .

View File

@ -26,7 +26,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include "main.h" #include "tst_bench_qhash.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include "main.h" #include "tst_bench_qhash.h"
#include <QFile> #include <QFile>
#include <QHash> #include <QHash>
@ -78,7 +78,8 @@ private:
void tst_QHash::initTestCase() void tst_QHash::initTestCase()
{ {
// small list of file paths // small list of strings (that happen to look like file paths produced long
// ago by cd ../.. && find . -print, but that's irrelevant).
QFile smallPathsData(QFINDTESTDATA("paths_small_data.txt")); QFile smallPathsData(QFINDTESTDATA("paths_small_data.txt"));
QVERIFY(smallPathsData.open(QIODevice::ReadOnly)); QVERIFY(smallPathsData.open(QIODevice::ReadOnly));
smallFilePaths = QString::fromLatin1(smallPathsData.readAll()).split(QLatin1Char('\n')); smallFilePaths = QString::fromLatin1(smallPathsData.readAll()).split(QLatin1Char('\n'));
@ -170,4 +171,4 @@ template <typename String> void tst_QHash::hashing_template()
QTEST_MAIN(tst_QHash) QTEST_MAIN(tst_QHash)
#include "main.moc" #include "tst_bench_qhash.moc"

View File

@ -1,12 +1,10 @@
# Generated from qlist.pro.
##################################################################### #####################################################################
## tst_bench_qlist Binary: ## tst_bench_qlist Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qlist qt_internal_add_benchmark(tst_bench_qlist
SOURCES SOURCES
main.cpp tst_bench_qlist.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -498,4 +498,4 @@ void tst_QList::removeFirstSpecial_impl() const
QTEST_APPLESS_MAIN(tst_QList) QTEST_APPLESS_MAIN(tst_QList)
#include "main.moc" #include "tst_bench_qlist.moc"

View File

@ -1,15 +1,10 @@
# Generated from qrect.pro.
##################################################################### #####################################################################
## tst_bench_qrect Binary: ## tst_bench_qrect Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qrect qt_internal_add_benchmark(tst_bench_qrect
SOURCES SOURCES
main.cpp tst_bench_qrect.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qrect.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -30,7 +30,7 @@
#include <QDebug> #include <QDebug>
#include <qtest.h> #include <qtest.h>
class tst_qrect : public QObject class tst_QRect : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -159,12 +159,12 @@ static void addRectPointData(bool includeProperArg = false)
} }
} }
void tst_qrect::contains_point_data() void tst_QRect::contains_point_data()
{ {
addRectPointData(true); addRectPointData(true);
} }
void tst_qrect::contains_point() void tst_QRect::contains_point()
{ {
QFETCH(QRectF, rf); QFETCH(QRectF, rf);
QFETCH(QPointF, pf); QFETCH(QPointF, pf);
@ -176,12 +176,12 @@ void tst_qrect::contains_point()
} }
} }
void tst_qrect::contains_rect_data() void tst_QRect::contains_rect_data()
{ {
addRectRectData(true); addRectRectData(true);
} }
void tst_qrect::contains_rect() void tst_QRect::contains_rect()
{ {
QFETCH(QRectF, rf1); QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2); QFETCH(QRectF, rf2);
@ -193,12 +193,12 @@ void tst_qrect::contains_rect()
} }
} }
void tst_qrect::intersects_data() void tst_QRect::intersects_data()
{ {
addRectRectData(); addRectRectData();
} }
void tst_qrect::intersects() void tst_QRect::intersects()
{ {
QFETCH(QRectF, rf1); QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2); QFETCH(QRectF, rf2);
@ -209,12 +209,12 @@ void tst_qrect::intersects()
} }
} }
void tst_qrect::intersected_data() void tst_QRect::intersected_data()
{ {
addRectRectData(); addRectRectData();
} }
void tst_qrect::intersected() void tst_QRect::intersected()
{ {
QFETCH(QRectF, rf1); QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2); QFETCH(QRectF, rf2);
@ -225,12 +225,12 @@ void tst_qrect::intersected()
} }
} }
void tst_qrect::united_data() void tst_QRect::united_data()
{ {
addRectRectData(); addRectRectData();
} }
void tst_qrect::united() void tst_QRect::united()
{ {
QFETCH(QRectF, rf1); QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2); QFETCH(QRectF, rf2);
@ -241,12 +241,12 @@ void tst_qrect::united()
} }
} }
void tst_qrect::contains_point_f_data() void tst_QRect::contains_point_f_data()
{ {
addRectPointData(); addRectPointData();
} }
void tst_qrect::contains_point_f() void tst_QRect::contains_point_f()
{ {
QFETCH(QRectF, rf); QFETCH(QRectF, rf);
QFETCH(QPointF, pf); QFETCH(QPointF, pf);
@ -255,12 +255,12 @@ void tst_qrect::contains_point_f()
} }
} }
void tst_qrect::contains_rect_f_data() void tst_QRect::contains_rect_f_data()
{ {
addRectRectData(); addRectRectData();
} }
void tst_qrect::contains_rect_f() void tst_QRect::contains_rect_f()
{ {
QFETCH(QRectF, rf1); QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2); QFETCH(QRectF, rf2);
@ -269,12 +269,12 @@ void tst_qrect::contains_rect_f()
} }
} }
void tst_qrect::intersects_f_data() void tst_QRect::intersects_f_data()
{ {
addRectRectData(); addRectRectData();
} }
void tst_qrect::intersects_f() void tst_QRect::intersects_f()
{ {
QFETCH(QRectF, rf1); QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2); QFETCH(QRectF, rf2);
@ -283,12 +283,12 @@ void tst_qrect::intersects_f()
} }
} }
void tst_qrect::intersected_f_data() void tst_QRect::intersected_f_data()
{ {
addRectRectData(); addRectRectData();
} }
void tst_qrect::intersected_f() void tst_QRect::intersected_f()
{ {
QFETCH(QRectF, rf1); QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2); QFETCH(QRectF, rf2);
@ -297,12 +297,12 @@ void tst_qrect::intersected_f()
} }
} }
void tst_qrect::united_f_data() void tst_QRect::united_f_data()
{ {
addRectRectData(); addRectRectData();
} }
void tst_qrect::united_f() void tst_QRect::united_f()
{ {
QFETCH(QRectF, rf1); QFETCH(QRectF, rf1);
QFETCH(QRectF, rf2); QFETCH(QRectF, rf2);
@ -311,6 +311,6 @@ void tst_qrect::united_f()
} }
} }
QTEST_MAIN(tst_qrect) QTEST_MAIN(tst_QRect)
#include "main.moc" #include "tst_bench_qrect.moc"

View File

@ -1,16 +1,11 @@
# Generated from qringbuffer.pro.
##################################################################### #####################################################################
## tst_bench_qringbuffer Binary: ## tst_bench_qringbuffer Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_qringbuffer qt_internal_add_benchmark(tst_bench_qringbuffer
SOURCES SOURCES
main.cpp tst_bench_qringbuffer.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::CorePrivate Qt::CorePrivate
Qt::Test Qt::Test
) )
#### Keys ignored in scope 1:.:.:qringbuffer.pro:<TRUE>:
# TEMPLATE = "app"

View File

@ -31,7 +31,7 @@
#include <qtest.h> #include <qtest.h>
class tst_qringbuffer : public QObject class tst_QRingBuffer : public QObject
{ {
Q_OBJECT Q_OBJECT
private slots: private slots:
@ -39,7 +39,7 @@ private slots:
void free(); void free();
}; };
void tst_qringbuffer::reserveAndRead() void tst_QRingBuffer::reserveAndRead()
{ {
QRingBuffer ringBuffer; QRingBuffer ringBuffer;
QBENCHMARK { QBENCHMARK {
@ -51,7 +51,7 @@ void tst_qringbuffer::reserveAndRead()
} }
} }
void tst_qringbuffer::free() void tst_QRingBuffer::free()
{ {
QRingBuffer ringBuffer; QRingBuffer ringBuffer;
QBENCHMARK { QBENCHMARK {
@ -66,6 +66,6 @@ void tst_qringbuffer::free()
} }
} }
QTEST_MAIN(tst_qringbuffer) QTEST_MAIN(tst_QRingBuffer)
#include "main.moc" #include "tst_bench_qringbuffer.moc"

View File

@ -1,12 +1,10 @@
# Generated from qset.pro.
##################################################################### #####################################################################
## tst_qset Binary: ## tst_bench_qset Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_qset qt_internal_add_benchmark(tst_bench_qset
SOURCES SOURCES
main.cpp tst_bench_qset.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Test Qt::Test
) )

View File

@ -125,4 +125,4 @@ void tst_QSet::intersect_complexType()
QTEST_MAIN(tst_QSet) QTEST_MAIN(tst_QSet)
#include "main.moc" #include "tst_bench_qset.moc"

View File

@ -1,12 +1,10 @@
# Generated from qstack.pro.
##################################################################### #####################################################################
## tst_bench_stack Binary: ## tst_bench_qstack Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(tst_bench_stack qt_internal_add_benchmark(tst_bench_qstack
SOURCES SOURCES
main.cpp tst_bench_qstack.cpp
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::CorePrivate Qt::CorePrivate
Qt::Test Qt::Test

View File

@ -81,4 +81,4 @@ void tst_QStack::qstack_pushpopone()
QTEST_MAIN(tst_QStack) QTEST_MAIN(tst_QStack)
#include "main.moc" #include "tst_bench_qstack.moc"