diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-07-05 17:59:29 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-07-06 13:50:55 +0200 |
commit | f74b2e3479751cd9ef86c0c38c8c64172c1129f7 (patch) | |
tree | b26786307eb7db8cd63d4c3135c94f7e57deee3d /tests/benchmarks/corelib/io | |
parent | 74e9b77f4f3bd823d836a2a1a557b294582bac5e (diff) |
QFile benchmark: always use Unbuffered for QFSFileEngine tests
Support for buffered usage with QFSFileEngine was dropped in 5.10;
trying to use it triggers an assert.
Task-number: QTBUG-91713
Pick-to: 5.15 6.1 6.2
Change-Id: I5f46e9f793310538344b96bf2efbeba34098de83
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/benchmarks/corelib/io')
-rw-r--r-- | tests/benchmarks/corelib/io/qfile/main.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp index 73b3ba8c48..6b37c7d27a 100644 --- a/tests/benchmarks/corelib/io/qfile/main.cpp +++ b/tests/benchmarks/corelib/io/qfile/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -193,9 +193,8 @@ void tst_qfile::readBigFile_QFile_data() void tst_qfile::readBigFile_QFSFileEngine_data() { #ifdef QT_BUILD_INTERNAL - readBigFile_data(QFSFileEngineBenchmark, QIODevice::NotOpen, QIODevice::NotOpen); + // Support for buffering dropped at 5.10, so only test Unbuffered readBigFile_data(QFSFileEngineBenchmark, QIODevice::NotOpen, QIODevice::Unbuffered); - readBigFile_data(QFSFileEngineBenchmark, QIODevice::Text, QIODevice::NotOpen); readBigFile_data(QFSFileEngineBenchmark, QIODevice::Text, QIODevice::Unbuffered); #else QTest::addColumn<int>("dummy"); @@ -356,7 +355,7 @@ void tst_qfile::seek() #ifdef QT_BUILD_INTERNAL case(QFSFileEngineBenchmark): { QFSFileEngine fse(filename); - fse.open(QIODevice::ReadOnly); + fse.open(QIODevice::ReadOnly | QIODevice::Unbuffered); QBENCHMARK { i=(i+1)%sp_size; fse.seek(seekpos[i]); @@ -437,7 +436,7 @@ void tst_qfile::open() case(QFSFileEngineBenchmark): { QBENCHMARK { QFSFileEngine fse(filename); - fse.open(QIODevice::ReadOnly); + fse.open(QIODevice::ReadOnly | QIODevice::Unbuffered); fse.close(); } } @@ -521,9 +520,8 @@ void tst_qfile::readSmallFiles_QFile_data() void tst_qfile::readSmallFiles_QFSFileEngine_data() { #ifdef QT_BUILD_INTERNAL - readSmallFiles_data(QFSFileEngineBenchmark, QIODevice::NotOpen, QIODevice::NotOpen); + // Support for buffering dropped at 5.10, so only test Unbuffered readSmallFiles_data(QFSFileEngineBenchmark, QIODevice::NotOpen, QIODevice::Unbuffered); - readSmallFiles_data(QFSFileEngineBenchmark, QIODevice::Text, QIODevice::NotOpen); readSmallFiles_data(QFSFileEngineBenchmark, QIODevice::Text, QIODevice::Unbuffered); #else QTest::addColumn<int>("dummy"); |