summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfile/tst_qfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/io/qfile/tst_qfile.cpp')
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index eeba882c70..2ef4c2c6a1 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -2618,9 +2618,10 @@ void tst_QFile::appendAndRead()
// Write blocks and read them back
for (int j = 0; j < 18; ++j) {
- writeFile.write(QByteArray(1 << j, '@'));
+ const int size = 1 << j;
+ writeFile.write(QByteArray(size, '@'));
writeFile.flush();
- QCOMPARE(readFile.read(1 << j).size(), 1 << j);
+ QCOMPARE(readFile.read(size).size(), size);
}
readFile.close();
@@ -2658,7 +2659,8 @@ void tst_QFile::handle()
QVERIFY(fd > 2);
QCOMPARE(int(file.handle()), fd);
char c = '\0';
- QT_READ(int(file.handle()), &c, 1);
+ const auto readResult = QT_READ(int(file.handle()), &c, 1);
+ QCOMPARE(readResult, static_cast<decltype(readResult)>(1));
QCOMPARE(c, '/');
// test if the QFile and the handle remain in sync