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:
parent
8f3032dfe0
commit
fa0ad643a6
@ -1473,7 +1473,24 @@ void tst_QFileInfo::isExecutable()
|
|||||||
QFileInfo fi(appPath);
|
QFileInfo fi(appPath);
|
||||||
QCOMPARE(fi.isExecutable(), true);
|
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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user