Fix fspp lstat tests on Mac OS X
This commit is contained in:
parent
fcf817fbdd
commit
6d3fe14c9e
@ -2,35 +2,36 @@
|
||||
|
||||
using ::testing::_;
|
||||
using ::testing::StrEq;
|
||||
using ::testing::AtLeast;
|
||||
|
||||
class FuseLstatPathParameterTest: public FuseLstatTest {
|
||||
};
|
||||
|
||||
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectRoot) {
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/"), _)).Times(1).WillOnce(ReturnIsDir);
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsDir);
|
||||
LstatPath("/");
|
||||
}
|
||||
|
||||
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectSimpleFile) {
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/myfile"), _)).Times(1).WillOnce(ReturnIsFile);
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/myfile"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsFile);
|
||||
LstatPath("/myfile");
|
||||
}
|
||||
|
||||
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectSimpleDir) {
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/mydir"), _)).Times(1).WillOnce(ReturnIsDir);
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/mydir"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsDir);
|
||||
LstatPath("/mydir/");
|
||||
}
|
||||
|
||||
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectNestedFile) {
|
||||
ReturnIsDirOnLstat("/mydir");
|
||||
ReturnIsDirOnLstat("/mydir/mydir2");
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/mydir/mydir2/myfile"), _)).Times(1).WillOnce(ReturnIsFile);
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/mydir/mydir2/myfile"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsFile);
|
||||
LstatPath("/mydir/mydir2/myfile");
|
||||
}
|
||||
|
||||
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectNestedDir) {
|
||||
ReturnIsDirOnLstat("/mydir");
|
||||
ReturnIsDirOnLstat("/mydir/mydir2");
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/mydir/mydir2/mydir3"), _)).Times(1).WillOnce(ReturnIsDir);
|
||||
EXPECT_CALL(fsimpl, lstat(StrEq("/mydir/mydir2/mydir3"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsDir);
|
||||
LstatPath("/mydir/mydir2/mydir3/");
|
||||
}
|
||||
|
@ -22,8 +22,8 @@ FuseTest::FuseTest(): fsimpl() {
|
||||
auto successAction = Return();
|
||||
ON_CALL(fsimpl, openFile(_,_)).WillByDefault(defaultAction);
|
||||
ON_CALL(fsimpl, closeFile(_)).WillByDefault(defaultAction);
|
||||
ON_CALL(fsimpl, lstat(_,_)).WillByDefault(defaultAction);
|
||||
ON_CALL(fsimpl, fstat(_,_)).WillByDefault(defaultAction);
|
||||
ON_CALL(fsimpl, lstat(_,_)).WillByDefault(Throw(FuseErrnoException(ENOENT)));
|
||||
ON_CALL(fsimpl, fstat(_,_)).WillByDefault(Throw(FuseErrnoException(ENOENT)));
|
||||
ON_CALL(fsimpl, truncate(_,_)).WillByDefault(defaultAction);
|
||||
ON_CALL(fsimpl, ftruncate(_,_)).WillByDefault(defaultAction);
|
||||
ON_CALL(fsimpl, read(_,_,_,_)).WillByDefault(defaultAction);
|
||||
@ -45,6 +45,7 @@ FuseTest::FuseTest(): fsimpl() {
|
||||
ON_CALL(fsimpl, chown(_,_,_)).WillByDefault(defaultAction);
|
||||
ON_CALL(fsimpl, createSymlink(_,_,_,_)).WillByDefault(defaultAction);
|
||||
ON_CALL(fsimpl, readSymlink(_,_,_)).WillByDefault(defaultAction);
|
||||
ReturnIsDirOnLstat("/");
|
||||
}
|
||||
|
||||
unique_ref<FuseTest::TempTestFS> FuseTest::TestFS() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user