summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-07-05 14:24:47 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-07-21 02:42:33 +0200
commit7ff67284926317f2bd3505ffd47092981a902610 (patch)
tree80d619dceb92c849edb3f19a5e13a0211c2d09d7 /tests
parent5e1386848c3576a272d0ad3d5091f502bac4310c (diff)
Move QSKIP()s to _data() functions in QFile benchmark
Skipping once in the data function is the clean way to do this. Saves setting up dummy data just so as to skip it, or setting up real data and then skippin on each row. Change-Id: I1666d134b6f206e8055fbbc5efd2e2116431a9c1 Reviewed-by: Jason McDonald <macadder1@gmail.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit 1cabfd168048b6b76b406015cc5a5c28e8f38cf0)
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/corelib/io/qfile/main.cpp35
1 files changed, 11 insertions, 24 deletions
diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp
index e5f13ae778..c63f073ff0 100644
--- a/tests/benchmarks/corelib/io/qfile/main.cpp
+++ b/tests/benchmarks/corelib/io/qfile/main.cpp
@@ -169,11 +169,7 @@ void tst_qfile::cleanupTestCase()
void tst_qfile::readBigFile_QFile() { readBigFile(); }
void tst_qfile::readBigFile_QFSFileEngine()
{
-#ifdef QT_BUILD_INTERNAL
readBigFile();
-#else
- QSKIP("This test requires -developer-build.");
-#endif
}
void tst_qfile::readBigFile_posix()
{
@@ -197,8 +193,7 @@ void tst_qfile::readBigFile_QFSFileEngine_data()
readBigFile_data(QFSFileEngineBenchmark, QIODevice::NotOpen, QIODevice::Unbuffered);
readBigFile_data(QFSFileEngineBenchmark, QIODevice::Text, QIODevice::Unbuffered);
#else
- QTest::addColumn<int>("dummy");
- QTest::newRow("Test will be skipped") << -1;
+ QSKIP("This test requires -developer-build.");
#endif
}
@@ -209,10 +204,13 @@ void tst_qfile::readBigFile_posix_data()
void tst_qfile::readBigFile_Win32_data()
{
+#ifdef Q_OS_WIN
readBigFile_data(Win32Benchmark, QIODevice::NotOpen, QIODevice::NotOpen);
+#else
+ QSKIP("This is Windows only benchmark.");
+#endif
}
-
void tst_qfile::readBigFile_data(BenchmarkType type, QIODevice::OpenModeFlag t, QIODevice::OpenModeFlag b)
{
QTest::addColumn<tst_qfile::BenchmarkType>("testType");
@@ -239,11 +237,6 @@ void tst_qfile::readBigFile()
QFETCH(QFile::OpenModeFlag, textMode);
QFETCH(QFile::OpenModeFlag, bufferedMode);
-#ifndef Q_OS_WIN
- if (testType == Win32Benchmark)
- QSKIP("This is Windows only benchmark.");
-#endif
-
char *buffer = new char[BUFSIZE];
createFile();
fillFile();
@@ -515,11 +508,7 @@ void tst_qfile::open()
void tst_qfile::readSmallFiles_QFile() { readSmallFiles(); }
void tst_qfile::readSmallFiles_QFSFileEngine()
{
-#ifdef QT_BUILD_INTERNAL
readSmallFiles();
-#else
- QSKIP("This test requires -developer-build.");
-#endif
}
void tst_qfile::readSmallFiles_posix()
{
@@ -546,8 +535,7 @@ void tst_qfile::readSmallFiles_QFSFileEngine_data()
readSmallFiles_data(QFSFileEngineBenchmark, QIODevice::NotOpen, QIODevice::Unbuffered);
readSmallFiles_data(QFSFileEngineBenchmark, QIODevice::Text, QIODevice::Unbuffered);
#else
- QTest::addColumn<int>("dummy");
- QTest::newRow("Test will be skipped") << -1;
+ QSKIP("This test requires -developer-build.");
#endif
}
@@ -558,10 +546,14 @@ void tst_qfile::readSmallFiles_posix_data()
void tst_qfile::readSmallFiles_Win32_data()
{
+
+#ifdef Q_OS_WIN
readSmallFiles_data(Win32Benchmark, QIODevice::NotOpen, QIODevice::NotOpen);
+#else
+ QSKIP("This is Windows only benchmark.");
+#endif
}
-
void tst_qfile::readSmallFiles_data(BenchmarkType type, QIODevice::OpenModeFlag t, QIODevice::OpenModeFlag b)
{
QTest::addColumn<tst_qfile::BenchmarkType>("testType");
@@ -614,11 +606,6 @@ void tst_qfile::readSmallFiles()
QFETCH(QFile::OpenModeFlag, textMode);
QFETCH(QFile::OpenModeFlag, bufferedMode);
-#ifndef Q_OS_WIN
- if (testType == Win32Benchmark)
- QSKIP("This is Windows only benchmark.");
-#endif
-
createSmallFiles();
QDir dir(tmpDirName);