diff options
author | Markku Heikkila <markku.heikkila@digia.com> | 2012-06-27 14:33:10 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-28 07:56:35 (GMT) |
commit | b1c46b4b3e322554146aed92cd6035cd9ba43982 (patch) | |
tree | 61e980e8761fe3f49790d5a2dd080426156a8d67 /tests | |
parent | 3ab453efca6d0d127f5d706ef623c611819979d4 (diff) | |
download | Qt-b1c46b4b3e322554146aed92cd6035cd9ba43982.zip Qt-b1c46b4b3e322554146aed92cd6035cd9ba43982.tar.gz Qt-b1c46b4b3e322554146aed92cd6035cd9ba43982.tar.bz2 |
Fixed tst_qfileinfo for windows.
Manually cherry picked from Qt5 SHA 85594bd9
Task-number: QTBUG-25563
Change-Id: I16131e33712702028843f0404b65ea9f7b04c7d5
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qfileinfo/tst_qfileinfo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index 5d65d1a..55931b7 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -1091,6 +1091,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 |