From af1ed483cf824b1c0dcd4cf7ab2a5f1698694958 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sat, 8 Sep 2018 04:26:32 -0700 Subject: [PATCH] On Windows, disable a few test cases that don't work --- test/cryfs-cli/CliTest_WrongEnvironment.cpp | 26 +++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/test/cryfs-cli/CliTest_WrongEnvironment.cpp b/test/cryfs-cli/CliTest_WrongEnvironment.cpp index eeb55026..796aac84 100644 --- a/test/cryfs-cli/CliTest_WrongEnvironment.cpp +++ b/test/cryfs-cli/CliTest_WrongEnvironment.cpp @@ -157,25 +157,28 @@ TEST_P(CliTest_WrongEnvironment, BaseDir_AllPermissions) { Test_Run_Success(); } +// boost::filesystem doesn't set permissions on Windows correctly +#if !defined(_MSC_VER) TEST_P(CliTest_WrongEnvironment, BaseDir_NoReadPermission) { SetNoReadPermission(basedir); Test_Run_Error("Error: Could not read from base directory", ErrorCode::InaccessibleBaseDir); } +TEST_P(CliTest_WrongEnvironment, BaseDir_NoExePermission) { + SetNoExePermission(basedir); + Test_Run_Error("Error: Could not write to base directory", ErrorCode::InaccessibleBaseDir); +} + TEST_P(CliTest_WrongEnvironment, BaseDir_NoWritePermission) { SetNoWritePermission(basedir); Test_Run_Error("Error: Could not write to base directory", ErrorCode::InaccessibleBaseDir); } -TEST_P(CliTest_WrongEnvironment, BaseDir_NoExePermission) { - SetNoExePermission(basedir); - Test_Run_Error("Error: Could not write to base directory", ErrorCode::InaccessibleBaseDir); -} - TEST_P(CliTest_WrongEnvironment, BaseDir_NoPermission) { SetNoPermission(basedir); Test_Run_Error("Error: Could not write to base directory", ErrorCode::InaccessibleBaseDir); } +#endif TEST_P(CliTest_WrongEnvironment, MountDir_DoesntExist) { _mountdir.remove(); @@ -215,22 +218,25 @@ TEST_P(CliTest_WrongEnvironment, MountDir_AllPermissions) { Test_Run_Success(); } +// boost::filesystem doesn't set permissions on Windows correctly +#if !defined(_MSC_VER) TEST_P(CliTest_WrongEnvironment, MountDir_NoReadPermission) { SetNoReadPermission(mountdir); Test_Run_Error("Error: Could not read from mount directory", ErrorCode::InaccessibleMountDir); } +TEST_P(CliTest_WrongEnvironment, MountDir_NoExePermission) { + SetNoExePermission(mountdir); + Test_Run_Error("Error: Could not write to mount directory", ErrorCode::InaccessibleMountDir); +} + TEST_P(CliTest_WrongEnvironment, MountDir_NoWritePermission) { SetNoWritePermission(mountdir); Test_Run_Error("Error: Could not write to mount directory", ErrorCode::InaccessibleMountDir); } -TEST_P(CliTest_WrongEnvironment, MountDir_NoExePermission) { - SetNoExePermission(mountdir); - Test_Run_Error("Error: Could not write to mount directory", ErrorCode::InaccessibleMountDir); -} - TEST_P(CliTest_WrongEnvironment, MountDir_NoPermission) { SetNoPermission(mountdir); Test_Run_Error("Error: Could not write to mount directory", ErrorCode::InaccessibleMountDir); } +#endif \ No newline at end of file