From bb0e9940723f729abcfee396c490637a12bdc377 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 2 Aug 2023 11:51:01 -0700 Subject: [PATCH] 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 --- tests/auto/corelib/io/qfile/tst_qfile.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index bcbe0f7636..214b6354db 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -222,7 +222,7 @@ private slots: void writeLargeDataBlock(); void readFromWriteOnlyFile(); 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(); #endif #ifdef Q_OS_UNIX @@ -2573,19 +2573,12 @@ void tst_QFile::writeToReadOnlyFile() 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 void tst_QFile::virtualFile() { // test if QFile works with virtual files - QString fname; -#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 + QString fname = "/proc/self/maps"; // consistency check QFileInfo fi(fname);