diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-08-18 11:48:29 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-08-30 19:21:08 +0200 |
commit | 9004a2412ba1f9976c2c61f01223dff852208c42 (patch) | |
tree | f06abeec8b9cc66abf0e66cc9048c7a0ed02a360 /tests/benchmarks/corelib/io/qfileinfo | |
parent | c2a6749af795386495b275684418d083410fa1e4 (diff) |
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>
Diffstat (limited to 'tests/benchmarks/corelib/io/qfileinfo')
-rw-r--r-- | tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp (renamed from tests/benchmarks/corelib/io/qfileinfo/main.cpp) | 26 |
2 files changed, 8 insertions, 25 deletions
diff --git a/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt b/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt index 1c088bf71a..8933b30cf3 100644 --- a/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt @@ -1,16 +1,11 @@ -# Generated from qfileinfo.pro. - ##################################################################### ## tst_bench_qfileinfo Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qfileinfo SOURCES - main.cpp + tst_bench_qfileinfo.cpp PUBLIC_LIBRARIES Qt::CorePrivate Qt::Test ) - -#### Keys ignored in scope 1:.:.:qfileinfo.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp index 2cd06eef27..21dbf47ba2 100644 --- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp +++ b/tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp @@ -35,7 +35,7 @@ #include "private/qfsfileengine_p.h" #include "../../../../shared/filesystem.h" -class qfileinfo : public QObject +class tst_QFileInfo : public QObject { Q_OBJECT private slots: @@ -45,34 +45,22 @@ private slots: void symLinkTargetPerformanceLNK(); void junctionTargetPerformanceMountpoint(); #endif - void initTestCase(); - void cleanupTestCase(); -public: - qfileinfo() : QObject() {}; }; -void qfileinfo::initTestCase() -{ -} - -void qfileinfo::cleanupTestCase() -{ -} - -void qfileinfo::existsTemporary() +void tst_QFileInfo::existsTemporary() { QString appPath = QCoreApplication::applicationFilePath(); QBENCHMARK { QFileInfo(appPath).exists(); } } -void qfileinfo::existsStatic() +void tst_QFileInfo::existsStatic() { QString appPath = QCoreApplication::applicationFilePath(); QBENCHMARK { QFileInfo::exists(appPath); } } #if defined(Q_OS_WIN) -void qfileinfo::symLinkTargetPerformanceLNK() +void tst_QFileInfo::symLinkTargetPerformanceLNK() { QVERIFY(QFile::link("file","link.lnk")); QFileInfo info("link.lnk"); @@ -86,7 +74,7 @@ void qfileinfo::symLinkTargetPerformanceLNK() QVERIFY(QFile::remove("link.lnk")); } -void qfileinfo::junctionTargetPerformanceMountpoint() +void tst_QFileInfo::junctionTargetPerformanceMountpoint() { wchar_t buffer[MAX_PATH]; QString rootPath = QDir::toNativeSeparators(QDir::rootPath()); @@ -109,6 +97,6 @@ void qfileinfo::junctionTargetPerformanceMountpoint() } #endif -QTEST_MAIN(qfileinfo) +QTEST_MAIN(tst_QFileInfo) -#include "main.moc" +#include "tst_bench_qfileinfo.moc" |