From fa0ad643a6f0018544197e4eb80e8cf2cbf700cf Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 21 Oct 2011 20:55:34 +0200 Subject: Check QFileInfo::isExecutable for symlinks, works as intended. Change-Id: I35acce7ba0e111f651864b9d16abf1bac1923f22 Reviewed-by: Thiago Macieira (Intel) --- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 + } -- cgit v1.2.3