diff options
author | Shane Kearns <ext-shane.2.kearns@nokia.com> | 2012-01-19 15:12:29 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-20 18:48:22 +0100 |
commit | 85594bd972c1aa9b3f92640d1624822e636431fb (patch) | |
tree | bf22cffc149c01b73616a645e4264585a64ad46a /tests | |
parent | e752a98b5aa7faefd8f05284dff9c43ac2ed794c (diff) |
QFileInfo autotest - don't fail on default configured windows systems
NTFS file access times are disabled by default since windows 6 for
performance reasons. The test now checks the registry setting and
reports XFAIL if access times are disabled.
Change-Id: Ia84ed0c8736e6c7d5817425006f6115d9f3e70a4
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 7ca41d3bf3..182c2c6ba8 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1028,6 +1028,19 @@ void tst_QFileInfo::fileTimes() //In Vista the last-access timestamp is not updated when the file is accessed/touched (by default). //To enable this the HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisableLastAccessUpdate //is set to 0, in the test machine. +#ifdef Q_OS_WIN + HKEY key; + if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\FileSystem", + 0, KEY_READ, &key)) { + DWORD disabledAccessTimes = 0; + DWORD size = sizeof(DWORD); + LONG error = RegQueryValueEx(key, L"NtfsDisableLastAccessUpdate" + , NULL, NULL, (LPBYTE)&disabledAccessTimes, &size); + if (ERROR_SUCCESS == error && disabledAccessTimes) + QEXPECT_FAIL("", "File access times are disabled in windows registry (this is the default setting)", Continue); + RegCloseKey(key); + } +#endif #ifdef Q_OS_WINCE QEXPECT_FAIL("simple", "WinCE only stores date of access data, not the time", Continue); #endif |