tst_QFile: restrict to running on Linux
My FreeBSD does not have /proc mounted, so this test doesn't run almost ever. I have no idea about OpenBSD and no one has tested Qt on AIX in over a decade. Change-Id: Ifbf974a4d10745b099b1fffd1777a598ee91eb5d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
01f58d7794
commit
bb0e994072
@ -222,7 +222,7 @@ private slots:
|
|||||||
void writeLargeDataBlock();
|
void writeLargeDataBlock();
|
||||||
void readFromWriteOnlyFile();
|
void readFromWriteOnlyFile();
|
||||||
void writeToReadOnlyFile();
|
void writeToReadOnlyFile();
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_AIX) || defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
|
#if defined(Q_OS_LINUX)
|
||||||
void virtualFile();
|
void virtualFile();
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
@ -2573,19 +2573,12 @@ void tst_QFile::writeToReadOnlyFile()
|
|||||||
QCOMPARE(file.write(&c, 1), qint64(-1));
|
QCOMPARE(file.write(&c, 1), qint64(-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_AIX) || defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
|
#if defined(Q_OS_LINUX)
|
||||||
// This platform have 0-sized virtual files
|
// This platform have 0-sized virtual files
|
||||||
void tst_QFile::virtualFile()
|
void tst_QFile::virtualFile()
|
||||||
{
|
{
|
||||||
// test if QFile works with virtual files
|
// test if QFile works with virtual files
|
||||||
QString fname;
|
QString fname = "/proc/self/maps";
|
||||||
#if defined(Q_OS_LINUX)
|
|
||||||
fname = "/proc/self/maps";
|
|
||||||
#elif defined(Q_OS_AIX)
|
|
||||||
fname = QString("/proc/%1/map").arg(getpid());
|
|
||||||
#else // defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
|
|
||||||
fname = "/proc/curproc/map";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// consistency check
|
// consistency check
|
||||||
QFileInfo fi(fname);
|
QFileInfo fi(fname);
|
||||||
|
Loading…
Reference in New Issue
Block a user