diff --git a/src/Main/FavoriteVolume.cpp b/src/Main/FavoriteVolume.cpp index 459d3fb827..c869fdc5dc 100644 --- a/src/Main/FavoriteVolume.cpp +++ b/src/Main/FavoriteVolume.cpp @@ -88,7 +88,10 @@ namespace VeraCrypt options.NoFilesystem = true; } else + { options.MountPoint.reset (new DirectoryPath (MountPoint)); + options.NoFilesystem = false; + } options.Path.reset (new VolumePath (Path)); options.PartitionInSystemEncryptionScope = System; diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp index 8ea98fb6e0..1226871663 100644 --- a/src/Main/UserInterface.cpp +++ b/src/Main/UserInterface.cpp @@ -1793,6 +1793,22 @@ const FileManager fileManagers[] = { } catch (StringFormatterException&) { } + // FavoriteVolume::ToMountOptions + { + MountOptions options; + options.NoFilesystem = true; + + FavoriteVolume favoriteWithMountPoint (VolumePath (wstring (L"dummy")), DirectoryPath (L"/media/veracrypt99"), 99, false, false); + favoriteWithMountPoint.ToMountOptions (options); + if (options.NoFilesystem || !options.MountPoint || options.MountPoint->IsEmpty()) + throw TestFailed (SRC_POS); + + FavoriteVolume favoriteWithoutMountPoint (VolumePath (wstring (L"dummy")), DirectoryPath (), 99, false, false); + favoriteWithoutMountPoint.ToMountOptions (options); + if (!options.NoFilesystem || options.MountPoint) + throw TestFailed (SRC_POS); + } + ShowInfo ("TESTS_PASSED"); }