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:
Bill Zissimopoulos 2017-11-15 10:48:15 -08:00
parent 7c11a45e6e
commit 77349c1330
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3
2 changed files with 11 additions and 11 deletions

View File

@ -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);

View File

@ -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);