From e8ed29d67922264e9e986cbc9b9b4de701e26d36 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 23 Jan 2016 21:21:13 +0100 Subject: [PATCH] tst_QTemporaryFile: test value of openMode() after open(). I had a doubt about what it would be, turns out it's ReadWrite. Turns out it's documented, too :-) Change-Id: I87c2ffc81aa240ffa88c495fe250b022d7fb3c21 Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp index 72dedf8be7..53c64166c4 100644 --- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp @@ -540,15 +540,16 @@ void tst_QTemporaryFile::keepOpenMode() { QTemporaryFile file; QVERIFY(file.open()); + QCOMPARE(file.openMode(), QIODevice::ReadWrite); QCOMPARE(file.write(data), (qint64)data.size()); QVERIFY(file.rename("temporary-file.txt")); QVERIFY(((QFile &)file).open(QIODevice::ReadOnly)); - QVERIFY(QIODevice::ReadOnly == file.openMode()); + QCOMPARE(file.openMode(), QIODevice::ReadOnly); QCOMPARE(file.readAll(), data); QVERIFY(((QFile &)file).open(QIODevice::WriteOnly)); - QVERIFY(QIODevice::WriteOnly == file.openMode()); + QCOMPARE(file.openMode(), QIODevice::WriteOnly); } }