Author: pschweitzer Date: Sun Mar 30 18:25:13 2014 New Revision: 62589
URL: http://svn.reactos.org/svn/reactos?rev=62589&view=rev Log: [TUNNELTEST] Reshuffle the test a bit so that it clearly fails on ReactOS: - Gather creation timestamp right after the first creation and always compare to it. This is to workaround the move = copy + delete hack from ReactOS which is resetting the timestamps (and thus making the test pass ;-)). - Wait more than 20ms (1s). If Microsoft FastFAT has a creation resolution of 10ms, we don't. So it would hide the thing as well.
With such changes, the test still works on Windows, whereas it fails on ReactOS
CORE-7272
Modified: trunk/rostests/win32/fs/tunneltest/tunneltest.c
Modified: trunk/rostests/win32/fs/tunneltest/tunneltest.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/win32/fs/tunneltest/tunnel... ============================================================================== --- trunk/rostests/win32/fs/tunneltest/tunneltest.c [iso-8859-1] (original) +++ trunk/rostests/win32/fs/tunneltest/tunneltest.c [iso-8859-1] Sun Mar 30 18:25:13 2014 @@ -75,10 +75,21 @@ fprintf(stderr, "Failed to create file1\n"); return GetLastError(); } + + /* Get its creation timestamp. It will be our reference */ + /* Get it in FileTime because file1 will renamed to file */ + if (GetFileTime(hFile, &FileTime, NULL, NULL) == FALSE) + { + fprintf(stderr, "Failed to read creation time\n"); + CloseHandle(hFile); + return GetLastError(); + } + CloseHandle(hFile);
/* Wait a least 10ms (resolution of FAT) */ - Sleep(10 * 2); + /* XXX: Increased to 1s for ReactOS... */ + Sleep(1000);
/* Create second file */ /* Remove old file from buffer */ @@ -114,24 +125,6 @@ return GetLastError(); }
- /* Time to compare creation time of both file & file1 */ - CopyPath[wcslen(TempPath) - 1] = 0; - - /* Open file and get its creation time */ - hFile = CreateFileW(CopyPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) - { - fprintf(stderr, "Failed to open file\n"); - return GetLastError(); - } - if (GetFileTime(hFile, &FileTime, NULL, NULL) == FALSE) - { - fprintf(stderr, "Failed to read creation time\n"); - CloseHandle(hFile); - return GetLastError(); - } - CloseHandle(hFile); - /* Open file1 and get its creation time */ hFile = CreateFileW(TempPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) @@ -147,7 +140,8 @@ } CloseHandle(hFile);
- /* Delete file */ + /* Delete files */ + CopyPath[wcslen(TempPath) - 1] = 0; DeleteFileW(TempPath); DeleteFileW(CopyPath);