mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
tst: winfsp-tests: setfileinfo_test, stream_setfileinfo_test:
- perform time tests around UNIX epoch to accommodate 32-bit file systems
This commit is contained in:
parent
7c11a45e6e
commit
77349c1330
@ -291,22 +291,22 @@ void setfileinfo_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout)
|
||||
ASSERT(Success);
|
||||
ASSERT(FILE_ATTRIBUTE_HIDDEN == FileInfo.dwFileAttributes);
|
||||
|
||||
*(PUINT64)&FileTime = 0x4200000042ULL;
|
||||
*(PUINT64)&FileTime = 116444736000000000ULL + 0x4200000042ULL;
|
||||
Success = SetFileTime(Handle, 0, &FileTime, &FileTime);
|
||||
ASSERT(Success);
|
||||
|
||||
Success = GetFileInformationByHandle(Handle, &FileInfo);
|
||||
ASSERT(Success);
|
||||
ASSERT(*(PUINT64)&FileInfo0.ftCreationTime == *(PUINT64)&FileInfo.ftCreationTime);
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftLastAccessTime);
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftLastWriteTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftLastAccessTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftLastWriteTime);
|
||||
|
||||
Success = SetFileTime(Handle, &FileTime, 0, 0);
|
||||
ASSERT(Success);
|
||||
|
||||
Success = GetFileInformationByHandle(Handle, &FileInfo);
|
||||
ASSERT(Success);
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftCreationTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftCreationTime);
|
||||
|
||||
Offset = SetFilePointer(Handle, 42, 0, 0);
|
||||
ASSERT(42 == Offset);
|
||||
|
@ -1194,22 +1194,22 @@ static void stream_setfileinfo_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoT
|
||||
ASSERT(Success);
|
||||
ASSERT(FILE_ATTRIBUTE_HIDDEN == FileInfo.dwFileAttributes);
|
||||
|
||||
*(PUINT64)&FileTime = 0x4200000042ULL;
|
||||
*(PUINT64)&FileTime = 116444736000000000ULL + 0x4200000042ULL;
|
||||
Success = SetFileTime(StreamHandle, 0, &FileTime, &FileTime);
|
||||
ASSERT(Success);
|
||||
|
||||
Success = GetFileInformationByHandle(StreamHandle, &FileInfo);
|
||||
ASSERT(Success);
|
||||
ASSERT(*(PUINT64)&FileInfo0.ftCreationTime == *(PUINT64)&FileInfo.ftCreationTime);
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftLastAccessTime);
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftLastWriteTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftLastAccessTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftLastWriteTime);
|
||||
|
||||
Success = SetFileTime(StreamHandle, &FileTime, 0, 0);
|
||||
ASSERT(Success);
|
||||
|
||||
Success = GetFileInformationByHandle(StreamHandle, &FileInfo);
|
||||
ASSERT(Success);
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftCreationTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftCreationTime);
|
||||
|
||||
Offset = SetFilePointer(StreamHandle, 42, 0, 0);
|
||||
ASSERT(42 == Offset);
|
||||
@ -1238,9 +1238,9 @@ static void stream_setfileinfo_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoT
|
||||
Success = GetFileInformationByHandle(Handle, &FileInfo);
|
||||
ASSERT(Success);
|
||||
ASSERT(0 != (FileInfo.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN));
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftLastAccessTime);
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftLastWriteTime);
|
||||
ASSERT(0x4200000042ULL == *(PUINT64)&FileInfo.ftCreationTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftLastAccessTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftLastWriteTime);
|
||||
ASSERT(116444736000000000ULL + 0x4200000042ULL == *(PUINT64)&FileInfo.ftCreationTime);
|
||||
ASSERT(0 == FileInfo.nFileSizeLow);
|
||||
ASSERT(0 == FileInfo.nFileSizeHigh);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user