Check QFileInfo::isExecutable for symlinks, works as intended.

Change-Id: I35acce7ba0e111f651864b9d16abf1bac1923f22
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
This commit is contained in:
David Faure 2011-10-21 20:55:34 +02:00 committed by Qt by Nokia
parent 8f3032dfe0
commit fa0ad643a6

View File

@ -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
}