diff --git a/src/cpp-utils/CMakeLists.txt b/src/cpp-utils/CMakeLists.txt index ab6a513e..859f5131 100644 --- a/src/cpp-utils/CMakeLists.txt +++ b/src/cpp-utils/CMakeLists.txt @@ -42,7 +42,7 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries(${PROJECT_NAME} PRIVATE pthread curl) -# TODO From Crypto++ 5.7 on, it should support cmake with find_package(). +# TODO From Crypto++ 5.7 on, it should support cmake with find_package() instead of find_library(). find_library(CryptoPP cryptopp) target_link_libraries(${PROJECT_NAME} PUBLIC ${CryptoPP} scrypt spdlog) diff --git a/test/fspp/fuse/access/FuseAccessErrorTest.cpp b/test/fspp/fuse/access/FuseAccessErrorTest.cpp index 8c07bb69..d3aa7794 100644 --- a/test/fspp/fuse/access/FuseAccessErrorTest.cpp +++ b/test/fspp/fuse/access/FuseAccessErrorTest.cpp @@ -7,6 +7,7 @@ using ::testing::StrEq; using ::testing::Throw; using ::testing::WithParamInterface; using ::testing::Values; +using ::testing::AtLeast; using namespace fspp::fuse; @@ -17,7 +18,7 @@ INSTANTIATE_TEST_CASE_P(FuseAccessErrorTest, FuseAccessErrorTest, Values(EACCES, TEST_P(FuseAccessErrorTest, ReturnedErrorIsCorrect) { ReturnIsFileOnLstat(FILENAME); EXPECT_CALL(fsimpl, access(StrEq(FILENAME), _)) - .Times(1).WillOnce(Throw(FuseErrnoException(GetParam()))); + .Times(AtLeast(1)).WillRepeatedly(Throw(FuseErrnoException(GetParam()))); int error = AccessFileReturnError(FILENAME, 0); EXPECT_EQ(GetParam(), error); diff --git a/test/fspp/testutils/FuseTest.cpp b/test/fspp/testutils/FuseTest.cpp index 484792ad..2995a2ad 100644 --- a/test/fspp/testutils/FuseTest.cpp +++ b/test/fspp/testutils/FuseTest.cpp @@ -19,7 +19,6 @@ MockFilesystem::~MockFilesystem() {} FuseTest::FuseTest(): fsimpl() { auto defaultAction = Throw(FuseErrnoException(EIO)); - auto successAction = Return(); ON_CALL(fsimpl, openFile(_,_)).WillByDefault(defaultAction); ON_CALL(fsimpl, closeFile(_)).WillByDefault(defaultAction); ON_CALL(fsimpl, lstat(_,_)).WillByDefault(Throw(FuseErrnoException(ENOENT))); @@ -30,7 +29,7 @@ FuseTest::FuseTest(): fsimpl() { ON_CALL(fsimpl, write(_,_,_,_)).WillByDefault(defaultAction); ON_CALL(fsimpl, fsync(_)).WillByDefault(defaultAction); ON_CALL(fsimpl, fdatasync(_)).WillByDefault(defaultAction); - ON_CALL(fsimpl, access(_,_)).WillByDefault(successAction); + ON_CALL(fsimpl, access(_,_)).WillByDefault(defaultAction); ON_CALL(fsimpl, createAndOpenFile(_,_,_,_)).WillByDefault(defaultAction); ON_CALL(fsimpl, mkdir(_,_,_,_)).WillByDefault(defaultAction); ON_CALL(fsimpl, rmdir(_)).WillByDefault(defaultAction); @@ -45,6 +44,8 @@ FuseTest::FuseTest(): fsimpl() { ON_CALL(fsimpl, chown(_,_,_)).WillByDefault(defaultAction); ON_CALL(fsimpl, createSymlink(_,_,_,_)).WillByDefault(defaultAction); ON_CALL(fsimpl, readSymlink(_,_,_)).WillByDefault(defaultAction); + + EXPECT_CALL(fsimpl, access(_,_)).WillRepeatedly(Return()); ReturnIsDirOnLstat("/"); }