diff options
author | Thomas Zander <t.zander@nokia.com> | 2010-10-11 15:43:04 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-10-12 12:59:07 (GMT) |
commit | f1f39af98afb2129daa5db2686200907de4c0999 (patch) | |
tree | 80917711dc8dd0c85394ba183bdaf4bfe8713b50 /tests/auto/qdir | |
parent | aa117bb48971c2fe56aff1e678ee3a7f6358eb0d (diff) | |
download | Qt-f1f39af98afb2129daa5db2686200907de4c0999.zip Qt-f1f39af98afb2129daa5db2686200907de4c0999.tar.gz Qt-f1f39af98afb2129daa5db2686200907de4c0999.tar.bz2 |
Test QDir::mkdir/mkpath return codes
Diffstat (limited to 'tests/auto/qdir')
-rw-r--r-- | tests/auto/qdir/tst_qdir.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index d540f29..9521921 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -103,6 +103,8 @@ private slots: void mkdir_data(); void mkdir(); + void makedirReturnCode(); + void rmdir_data(); void rmdir(); @@ -295,6 +297,17 @@ void tst_QDir::mkdir() QVERIFY(fi.exists() && fi.isDir()); } +void tst_QDir::makedirReturnCode() +{ + QString dirName = QString::fromLatin1("makedirReturnCode"); + QDir::current().rmdir(dirName); // cleanup a previous run. + QDir dir(dirName); + QVERIFY(!dir.exists()); + QVERIFY(QDir::current().mkdir(dirName)); + QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing dir will fail. + QVERIFY(QDir::current().mkpath(dirName)); // calling mkpath on an existing dir will pass +} + void tst_QDir::rmdir_data() { QTest::addColumn<QString>("path"); |