summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2011-10-21 20:55:34 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-23 00:56:45 +0200
commitfa0ad643a6f0018544197e4eb80e8cf2cbf700cf (patch)
tree240c638e54499b2a4a53e899a93bc54e4b36c745
parent8f3032dfe080c47c6fab7244a356064ce313f050 (diff)
Check QFileInfo::isExecutable for symlinks, works as intended.
Change-Id: I35acce7ba0e111f651864b9d16abf1bac1923f22 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 4adfb9fad8..5a43bca2c4 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -1473,7 +1473,24 @@ void tst_QFileInfo::isExecutable()
QFileInfo fi(appPath);
QCOMPARE(fi.isExecutable(), true);
- QCOMPARE(QFileInfo("qfileinfo.pro").isExecutable(), false);
+ QCOMPARE(QFileInfo(SRCDIR "qfileinfo.pro").isExecutable(), false);
+
+#ifdef Q_OS_UNIX
+ QFile::remove("link.lnk");
+
+ // Symlink to executable
+ QFile appFile(appPath);
+ QVERIFY(appFile.link("link.lnk"));
+ QCOMPARE(QFileInfo("link.lnk").isExecutable(), true);
+ QFile::remove("link.lnk");
+
+ // Symlink to .pro file
+ QFile proFile(SRCDIR "qfileinfo.pro");
+ QVERIFY(proFile.link("link.lnk"));
+ QCOMPARE(QFileInfo("link.lnk").isExecutable(), false);
+ QFile::remove("link.lnk");
+#endif
+
}