mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-30 11:38:39 -05:00 
			
		
		
		
	tst: fix tests broken by new mountmgr func
This commit is contained in:
		| @@ -319,6 +319,15 @@ void mount_preflight_dotest(PWSTR DeviceName) | |||||||
|     MountPoint[2] = L'\0'; |     MountPoint[2] = L'\0'; | ||||||
|  |  | ||||||
|     GetTestDirectory(DirBuf); |     GetTestDirectory(DirBuf); | ||||||
|  |     /* | ||||||
|  |      * Mount points starting with \\?\X: or \\.\X: are now considered MountManager mountpoints. | ||||||
|  |      * So skip the \\?\ prefix to avoid this problem. | ||||||
|  |      */ | ||||||
|  |     if (L'\\' == DirBuf[0] && | ||||||
|  |         L'\\' == DirBuf[1] && | ||||||
|  |         (L'?' == DirBuf[2] || L'.' == DirBuf[2]) && | ||||||
|  |         L'\\' == DirBuf[3]) | ||||||
|  |         memmove(DirBuf, DirBuf + 4, (wcslen(DirBuf + 4) + 1) * sizeof(WCHAR)); | ||||||
|  |  | ||||||
|     Drives = GetLogicalDrives(); |     Drives = GetLogicalDrives(); | ||||||
|     ASSERT(0 != Drives); |     ASSERT(0 != Drives); | ||||||
|   | |||||||
| @@ -84,12 +84,14 @@ static void volpath_dotest(ULONG Flags, PWSTR Prefix) | |||||||
|  |  | ||||||
| static void volpath_test(void) | static void volpath_test(void) | ||||||
| { | { | ||||||
|     if (NtfsTests) |     /* | ||||||
|     { |      * GetVolumePathName is not reliable on WinFsp file systems | ||||||
|         WCHAR DirBuf[MAX_PATH]; |      * when *not* using the MountManager and therefore disable | ||||||
|         GetTestDirectory(DirBuf); |      * this test when using a non-MountManager mount point. | ||||||
|         volpath_dotest(-1, DirBuf); |      */ | ||||||
|     } |     if (!NtfsTests && !OptMountPoint) | ||||||
|  |         TEST(volpath_test); | ||||||
|  |  | ||||||
|     if (WinFspDiskTests) |     if (WinFspDiskTests) | ||||||
|         volpath_dotest(MemfsDisk, 0); |         volpath_dotest(MemfsDisk, 0); | ||||||
|     if (WinFspNetTests) |     if (WinFspNetTests) | ||||||
| @@ -182,8 +184,30 @@ static void volpath_mount_test(void) | |||||||
|  |  | ||||||
|     if (WinFspDiskTests) |     if (WinFspDiskTests) | ||||||
|     { |     { | ||||||
|  |         WCHAR MountPoint[7]; | ||||||
|  |         DWORD Drives; | ||||||
|  |         WCHAR Drive; | ||||||
|  |  | ||||||
|  |         MountPoint[0] = L'\\'; | ||||||
|  |         MountPoint[1] = L'\\'; | ||||||
|  |         MountPoint[2] = L'.'; | ||||||
|  |         MountPoint[3] = L'\\'; | ||||||
|  |         MountPoint[4] = L'C'; | ||||||
|  |         MountPoint[5] = L':'; | ||||||
|  |         MountPoint[6] = L'\0'; | ||||||
|  |  | ||||||
|  |         Drives = GetLogicalDrives(); | ||||||
|  |         ASSERT(0 != Drives); | ||||||
|  |  | ||||||
|  |         for (Drive = 'Z'; 'A' <= Drive; Drive--) | ||||||
|  |             if (0 == (Drives & (1 << (Drive - 'A')))) | ||||||
|  |                 break; | ||||||
|  |         ASSERT('A' <= Drive); | ||||||
|  |  | ||||||
|  |         MountPoint[4] = Drive; | ||||||
|  |  | ||||||
|         //volpath_mount_dotest(MemfsDisk, 0, 0); |         //volpath_mount_dotest(MemfsDisk, 0, 0); | ||||||
|         volpath_mount_dotest(MemfsDisk, 0, L"\\\\.\\m:"); |         volpath_mount_dotest(MemfsDisk, 0, MountPoint); | ||||||
|     } |     } | ||||||
|     if (WinFspNetTests) |     if (WinFspNetTests) | ||||||
|     { |     { | ||||||
| @@ -193,6 +217,12 @@ static void volpath_mount_test(void) | |||||||
|  |  | ||||||
| void volpath_tests(void) | void volpath_tests(void) | ||||||
| { | { | ||||||
|  |     /* | ||||||
|  |      * GetVolumePathName is not reliable on WinFsp file systems | ||||||
|  |      * when *not* using the MountManager and therefore disable | ||||||
|  |      * this test when using a non-MountManager mount point. | ||||||
|  |      */ | ||||||
|  |     if (!NtfsTests && !OptMountPoint) | ||||||
|         TEST(volpath_test); |         TEST(volpath_test); | ||||||
|  |  | ||||||
|     /* |     /* | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user