diff --git a/tst/winfsp-tests/stream-tests.c b/tst/winfsp-tests/stream-tests.c index a1803aba..1406fd7e 100644 --- a/tst/winfsp-tests/stream-tests.c +++ b/tst/winfsp-tests/stream-tests.c @@ -1645,6 +1645,8 @@ static void stream_getstreaminfo_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInf Success = FindNextStreamW(Handle, &FindData); ASSERT(!Success); ASSERT(ERROR_HANDLE_EOF == GetLastError()); + Success = FindClose(Handle); + ASSERT(Success); StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\file5", Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs)); @@ -1683,6 +1685,43 @@ static void stream_getstreaminfo_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInf Success = FindClose(Handle); ASSERT(Success); + StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\file5:s50", + Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs)); + Handle = FindFirstStreamW(FilePath, FindStreamInfoStandard, &FindData, 0); + ASSERT(INVALID_HANDLE_VALUE != Handle); + + FileCount = FileTotal = 0; + do + { + unsigned long ul; + wchar_t *endp; + + if (1 > FileCount) + { + FileCount++; + ASSERT(0 == wcscmp(FindData.cStreamName, L"::$DATA")); + continue; + } + + ASSERT(0 == wcsncmp(FindData.cStreamName, L":s", 2)); + ul = wcstoul(FindData.cStreamName + 2, &endp, 10); + ASSERT(0 != ul); + ASSERT(L':' == *endp); + + FileCount++; + FileTotal += ul; + + if (0 < SleepTimeout && 5 == FileCount) + Sleep(SleepTimeout); + } while (FindNextStreamW(Handle, &FindData)); + ASSERT(ERROR_HANDLE_EOF == GetLastError()); + + ASSERT(101 == FileCount); + ASSERT(101 * 100 / 2 == FileTotal); + + Success = FindClose(Handle); + ASSERT(Success); + StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\dir1", Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs)); Handle = FindFirstStreamW(FilePath, FindStreamInfoStandard, &FindData, 0);