[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 

svn path=/trunk/; revision=62589
This commit is contained in:
Pierre Schweitzer 2014-03-30 18:25:13 +00:00
parent f6d147a5e1
commit b6aa0990cd

View file

@ -75,10 +75,21 @@ int wmain(int argc, WCHAR * argv[])
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 @@ int wmain(int argc, WCHAR * argv[])
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 @@ int wmain(int argc, WCHAR * argv[])
}
CloseHandle(hFile);
/* Delete file */
/* Delete files */
CopyPath[wcslen(TempPath) - 1] = 0;
DeleteFileW(TempPath);
DeleteFileW(CopyPath);