From 65bad8e2c8894f23f47ff2b7418bcd1fc71d4602 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 4 Mar 2010 15:34:22 +0100 Subject: Fixed QFileInfo autotest to skip on NFS. Exported the isLikelyToBeNfs() function to skip the fileInfo Test on NFS. Otherwise the Test will fail, because the FileSystemTimes are not synchronized. --- src/corelib/io/qsettings.cpp | 8 ++++---- tests/auto/qfileinfo/tst_qfileinfo.cpp | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 8ee42e7..e5d182e 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -134,7 +134,7 @@ QT_BEGIN_INCLUDE_NAMESPACE # include QT_END_INCLUDE_NAMESPACE -static bool isLikelyToBeNfs(int handle) +Q_AUTOTEST_EXPORT bool isLikelyToBeNfs(int handle) { struct statfs buf; if (fstatfs(handle, &buf) != 0) @@ -160,7 +160,7 @@ QT_END_INCLUDE_NAMESPACE # define AUTOFSNG_SUPER_MAGIC 0x7d92b1a0 # endif -static bool isLikelyToBeNfs(int handle) +Q_AUTOTEST_EXPORT bool isLikelyToBeNfs(int handle) { struct statfs buf; if (fstatfs(handle, &buf) != 0) @@ -177,7 +177,7 @@ QT_BEGIN_INCLUDE_NAMESPACE # include QT_END_INCLUDE_NAMESPACE -static bool isLikelyToBeNfs(int handle) +Q_AUTOTEST_EXPORT bool isLikelyToBeNfs(int handle) { struct statvfs buf; if (fstatvfs(handle, &buf) != 0) @@ -189,7 +189,7 @@ static bool isLikelyToBeNfs(int handle) #endif } #else -static inline bool isLikelyToBeNfs(int /* handle */) +Q_AUTOTEST_EXPORT inline bool isLikelyToBeNfs(int /* handle */) { return true; } diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index 208110a..0306bb6 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -70,6 +70,8 @@ # define SRCDIR "" #endif +extern bool isLikelyToBeNfs(int /* handle */); + //TESTED_CLASS= //TESTED_FILES= @@ -939,6 +941,8 @@ void tst_QFileInfo::fileTimes() QEXPECT_FAIL("longfile absolutepath", "Maximum total filepath cannot exceed 256 characters in Symbian", Abort); #endif QVERIFY(file.open(QFile::WriteOnly | QFile::Text)); + if(isLikelyToBeNfs(file.handle())) + QSKIP("This Test doesn't work on NFS", SkipAll); QTextStream ts(&file); ts << fileName << endl; } -- cgit v0.12