diff options
author | Zeno Albisser <zeno.albisser@nokia.com> | 2010-04-13 09:59:08 (GMT) |
---|---|---|
committer | Zeno Albisser <zeno.albisser@nokia.com> | 2010-04-13 10:46:06 (GMT) |
commit | 2bed031297e9edeb7e8493888c0a24f2dca3c370 (patch) | |
tree | 25c93bc3739e29502c7c862c13e7d0f9b1eb4c94 | |
parent | 0fa2bea5a90c0f935aa6e4ef765cf5a24d94c23d (diff) | |
download | Qt-2bed031297e9edeb7e8493888c0a24f2dca3c370.zip Qt-2bed031297e9edeb7e8493888c0a24f2dca3c370.tar.gz Qt-2bed031297e9edeb7e8493888c0a24f2dca3c370.tar.bz2 |
Replaced qWarning with QCOMPARE/QVERIFY statements in tst_QFileInfo
Reviewed-by: Joao
-rw-r--r-- | tests/auto/qfileinfo/tst_qfileinfo.cpp | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index eba04d9..da5c772 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -1087,11 +1087,7 @@ void tst_QFileInfo::isHidden_data() QTest::newRow("C:/path/to/hidden-directory/.") << QDir::currentPath() + QString::fromLatin1("/hidden-directory/.") << true; #endif #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) - - if (!QDir("./.hidden-directory").exists() - && !QDir().mkdir("./.hidden-directory")) - qWarning("Unable to create directory './.hidden-directory'. Some tests will fail."); - + QVERIFY(QDir("./.hidden-directory").exists() || QDir().mkdir("./.hidden-directory")); QTest::newRow("/path/to/.hidden-directory") << QDir::currentPath() + QString("/.hidden-directory") << true; QTest::newRow("/path/to/.hidden-directory/.") << QDir::currentPath() + QString("/.hidden-directory/.") << true; QTest::newRow("/path/to/.hidden-directory/..") << QDir::currentPath() + QString("/.hidden-directory/..") << true; @@ -1119,34 +1115,24 @@ void tst_QFileInfo::isHidden_data() { QFile file(hiddenFileName); - if (file.open(QIODevice::WriteOnly)) { - QTextStream t(&file); - t << "foobar"; - } else { - qWarning("Failed to create hidden file"); - } + QVERIFY(file.open(QIODevice::WriteOnly)); + QTextStream t(&file); + t << "foobar"; + QFile file2(notHiddenFileName); - if (file2.open(QIODevice::WriteOnly)) { - QTextStream t(&file); - t << "foobar"; - } else { - qWarning("Failed to create non-hidden file"); - } + QVERIFY(file2.open(QIODevice::WriteOnly)) + QTextStream t(&file); + t << "foobar"; } RFs rfs; TInt err = rfs.Connect(); - if (err == KErrNone) { - HBufC* symFile = qt_QString2HBufC(hiddenFileName); - err = rfs.SetAtt(*symFile, KEntryAttHidden, 0); - rfs.Close(); - delete symFile; - if (err != KErrNone) { - qWarning("Failed to set hidden attribute for test file"); - } - } else { - qWarning("Failed to open RFs session"); - } + QCOMPARE(err, KErrNone); + HBufC* symFile = qt_QString2HBufC(hiddenFileName); + err = rfs.SetAtt(*symFile, KEntryAttHidden, 0); + rfs.Close(); + delete symFile; + QCOMPARE(err, KErrNone); #endif } |