Fix other lstat test cases on Mac OS

This commit is contained in:
Sebastian Messmer 2016-02-14 02:09:58 +01:00
parent be4fb6fbee
commit 190d465cf3

View File

@ -7,6 +7,7 @@ using ::testing::_;
using ::testing::Throw;
using ::testing::WithParamInterface;
using ::testing::Values;
using ::testing::AtLeast;
using fspp::fuse::FuseErrnoException;
@ -16,14 +17,14 @@ public:
INSTANTIATE_TEST_CASE_P(LstatErrorCodes, FuseLstatErrorTest, Values(EACCES, EBADF, EFAULT, ELOOP, ENAMETOOLONG, ENOENT, ENOMEM, ENOTDIR, EOVERFLOW, EINVAL, ENOTDIR));
TEST_F(FuseLstatErrorTest, ReturnNoError) {
EXPECT_CALL(fsimpl, lstat(StrEq(FILENAME), _)).Times(1).WillOnce(ReturnIsFile);
EXPECT_CALL(fsimpl, lstat(StrEq(FILENAME), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsFile);
errno = 0;
int error = LstatPathReturnError(FILENAME);
EXPECT_EQ(0, error);
}
TEST_P(FuseLstatErrorTest, ReturnError) {
EXPECT_CALL(fsimpl, lstat(StrEq(FILENAME), _)).Times(1).WillOnce(Throw(FuseErrnoException(GetParam())));
EXPECT_CALL(fsimpl, lstat(StrEq(FILENAME), _)).Times(AtLeast(1)).WillRepeatedly(Throw(FuseErrnoException(GetParam())));
int error = LstatPathReturnError(FILENAME);
EXPECT_EQ(GetParam(), error);
}