mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-11-04 04:58:05 -06:00 
			
		
		
		
	tst: winfsp-tests: stream_getstreaminfo_test
This commit is contained in:
		@@ -1645,6 +1645,8 @@ static void stream_getstreaminfo_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInf
 | 
				
			|||||||
    Success = FindNextStreamW(Handle, &FindData);
 | 
					    Success = FindNextStreamW(Handle, &FindData);
 | 
				
			||||||
    ASSERT(!Success);
 | 
					    ASSERT(!Success);
 | 
				
			||||||
    ASSERT(ERROR_HANDLE_EOF == GetLastError());
 | 
					    ASSERT(ERROR_HANDLE_EOF == GetLastError());
 | 
				
			||||||
 | 
					    Success = FindClose(Handle);
 | 
				
			||||||
 | 
					    ASSERT(Success);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\file5",
 | 
					    StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\file5",
 | 
				
			||||||
        Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs));
 | 
					        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);
 | 
					    Success = FindClose(Handle);
 | 
				
			||||||
    ASSERT(Success);
 | 
					    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",
 | 
					    StringCbPrintfW(FilePath, sizeof FilePath, L"%s%s\\dir1",
 | 
				
			||||||
        Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs));
 | 
					        Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs));
 | 
				
			||||||
    Handle = FindFirstStreamW(FilePath, FindStreamInfoStandard, &FindData, 0);
 | 
					    Handle = FindFirstStreamW(FilePath, FindStreamInfoStandard, &FindData, 0);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user