summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfile
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-12-30 15:51:05 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-03 02:57:12 +0100
commitfda36df6babf20bcfd04a54a1336a9c26e72a8ef (patch)
tree0c09018e6db15ea40e156b38854e224e62e9130f /tests/auto/corelib/io/qfile
parent39f3ee8a5dd499cf86f95e7fc9200eb3226b16be (diff)
Use true and false in preference to TRUE and FALSE in tests.
Use the C++ boolean constants true and false instead of the C macros TRUE and FALSE (which are actually integers), and use QVERIFY instead of QCOMPARE for verifying simple boolean expressions. Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/io/qfile')
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index cae97f80c4..ccdbc85293 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -404,7 +404,7 @@ void tst_QFile::cleanupTestCase()
void tst_QFile::exists()
{
QFile f( QFINDTESTDATA("testfile.txt") );
- QCOMPARE( f.exists(), (bool)TRUE );
+ QVERIFY(f.exists());
QFile file("nobodyhassuchafile");
file.remove();
@@ -443,41 +443,41 @@ void tst_QFile::open_data()
#endif
QTest::newRow( "exist_readOnly" )
<< QString(QFINDTESTDATA("testfile.txt")) << int(QIODevice::ReadOnly)
- << (bool)TRUE << QFile::NoError;
+ << true << QFile::NoError;
QTest::newRow( "exist_writeOnly" )
<< QString("readonlyfile")
<< int(QIODevice::WriteOnly)
- << (bool)FALSE
+ << false
<< QFile::OpenError;
QTest::newRow( "exist_append" )
<< QString("readonlyfile") << int(QIODevice::Append)
- << (bool)FALSE << QFile::OpenError;
+ << false << QFile::OpenError;
QTest::newRow( "nonexist_readOnly" )
<< QString("nonExist.txt") << int(QIODevice::ReadOnly)
- << (bool)FALSE << QFile::OpenError;
+ << false << QFile::OpenError;
QTest::newRow("emptyfile")
<< QString("")
<< int(QIODevice::ReadOnly)
- << (bool)FALSE
+ << false
<< QFile::OpenError;
- QTest::newRow("nullfile") << QString() << int(QIODevice::ReadOnly) << (bool)FALSE
+ QTest::newRow("nullfile") << QString() << int(QIODevice::ReadOnly) << false
<< QFile::OpenError;
- QTest::newRow("two-dots") << QString(QFINDTESTDATA("two.dots.file")) << int(QIODevice::ReadOnly) << (bool)TRUE
+ QTest::newRow("two-dots") << QString(QFINDTESTDATA("two.dots.file")) << int(QIODevice::ReadOnly) << true
<< QFile::NoError;
QTest::newRow("readonlyfile") << QString("readonlyfile") << int(QIODevice::WriteOnly)
- << (bool)FALSE << QFile::OpenError;
+ << false << QFile::OpenError;
QTest::newRow("noreadfile") << QString("noreadfile") << int(QIODevice::ReadOnly)
- << (bool)FALSE << QFile::OpenError;
+ << false << QFile::OpenError;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
QTest::newRow("//./PhysicalDrive0") << QString("//./PhysicalDrive0") << int(QIODevice::ReadOnly)
- << (bool)TRUE << QFile::NoError;
+ << true << QFile::NoError;
QTest::newRow("uncFile") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" << int(QIODevice::ReadOnly)
<< true << QFile::NoError;
#endif
@@ -694,7 +694,7 @@ void tst_QFile::atEnd()
bool end = f.atEnd();
f.close();
- QCOMPARE( end, (bool)TRUE );
+ QVERIFY(end);
}
void tst_QFile::readLine()