From cc7e0b5c2c351441f0a3f04e8471d0eac2c97601 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 5 Jul 2021 18:16:12 +0200 Subject: [PATCH] QFile benchmark: purge fatuous function, inline several more The empty cleanupTestCase() was just clutter. Various tests that shared a common implementation (using different data) might just as well be inline in the class body. Change-Id: I5046d7e6ad5a6425df9f9e0a0a705e229d9d0717 Reviewed-by: Volker Hilsheimer --- tests/benchmarks/corelib/io/qfile/main.cpp | 47 ++++------------------ 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp index 10a96c3f97..357205cbe8 100644 --- a/tests/benchmarks/corelib/io/qfile/main.cpp +++ b/tests/benchmarks/corelib/io/qfile/main.cpp @@ -80,17 +80,16 @@ public: }; private slots: void initTestCase(); - void cleanupTestCase(); void open_data(); void open(); void seek_data(); void seek(); - void readSmallFiles_QFile(); - void readSmallFiles_QFSFileEngine(); - void readSmallFiles_posix(); - void readSmallFiles_Win32(); + void readSmallFiles_QFile() { readSmallFiles(); } + void readSmallFiles_QFSFileEngine() { readSmallFiles(); } + void readSmallFiles_posix() { readSmallFiles(); } + void readSmallFiles_Win32() { readSmallFiles(); } void readSmallFiles_QFile_data(); void readSmallFiles_QFSFileEngine_data(); @@ -102,10 +101,10 @@ private slots: void readBigFile_posix_data(); void readBigFile_Win32_data(); - void readBigFile_QFile(); - void readBigFile_QFSFileEngine(); - void readBigFile_posix(); - void readBigFile_Win32(); + void readBigFile_QFile() { readBigFile(); } + void readBigFile_QFSFileEngine() { readBigFile(); } + void readBigFile_posix() { readBigFile(); } + void readBigFile_Win32() { readBigFile(); } private: void readFile_data(BenchmarkType type, QIODevice::OpenModeFlag t, QIODevice::OpenModeFlag b); @@ -161,10 +160,6 @@ void tst_qfile::initTestCase() { } -void tst_qfile::cleanupTestCase() -{ -} - void tst_qfile::readFile_data(BenchmarkType type, QIODevice::OpenModeFlag t, QIODevice::OpenModeFlag b) { @@ -189,17 +184,6 @@ void tst_qfile::readFile_data(BenchmarkType type, QIODevice::OpenModeFlag t, } } -void tst_qfile::readBigFile_QFile() { readBigFile(); } -void tst_qfile::readBigFile_QFSFileEngine() -{ - readBigFile(); -} -void tst_qfile::readBigFile_posix() -{ - readBigFile(); -} -void tst_qfile::readBigFile_Win32() { readBigFile(); } - void tst_qfile::readBigFile_QFile_data() { readFile_data(QFileBenchmark, QIODevice::NotOpen, QIODevice::NotOpen); @@ -486,21 +470,6 @@ void tst_qfile::open() removeFile(); } - -void tst_qfile::readSmallFiles_QFile() { readSmallFiles(); } -void tst_qfile::readSmallFiles_QFSFileEngine() -{ - readSmallFiles(); -} -void tst_qfile::readSmallFiles_posix() -{ - readSmallFiles(); -} -void tst_qfile::readSmallFiles_Win32() -{ - readSmallFiles(); -} - void tst_qfile::readSmallFiles_QFile_data() { readFile_data(QFileBenchmark, QIODevice::NotOpen, QIODevice::NotOpen);