2014-12-02 22:16:48 +01:00
|
|
|
#include "testutils/FuseReadDirTest.h"
|
|
|
|
|
2019-10-13 17:49:57 +02:00
|
|
|
using ::testing::Eq;
|
2014-12-02 22:16:48 +01:00
|
|
|
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
class FuseReadDirDirnameTest: public FuseReadDirTest {
|
|
|
|
public:
|
|
|
|
};
|
|
|
|
|
|
|
|
TEST_F(FuseReadDirDirnameTest, ReadRootDir) {
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, readDir(Eq("/")))
|
2014-12-02 22:16:48 +01:00
|
|
|
.Times(1).WillOnce(ReturnDirEntries({}));
|
|
|
|
|
|
|
|
ReadDir("/");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseReadDirDirnameTest, ReadDir) {
|
|
|
|
ReturnIsDirOnLstat("/mydir");
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, readDir(Eq("/mydir")))
|
2014-12-02 22:16:48 +01:00
|
|
|
.Times(1).WillOnce(ReturnDirEntries({}));
|
|
|
|
|
|
|
|
ReadDir("/mydir");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseReadDirDirnameTest, ReadDirNested) {
|
|
|
|
ReturnIsDirOnLstat("/mydir");
|
|
|
|
ReturnIsDirOnLstat("/mydir/mydir2");
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, readDir(Eq("/mydir/mydir2")))
|
2014-12-02 22:16:48 +01:00
|
|
|
.Times(1).WillOnce(ReturnDirEntries({}));
|
|
|
|
|
|
|
|
ReadDir("/mydir/mydir2");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseReadDirDirnameTest, ReadDirNested2) {
|
|
|
|
ReturnIsDirOnLstat("/mydir");
|
|
|
|
ReturnIsDirOnLstat("/mydir/mydir2");
|
|
|
|
ReturnIsDirOnLstat("/mydir/mydir2/mydir3");
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, readDir(Eq("/mydir/mydir2/mydir3")))
|
2014-12-02 22:16:48 +01:00
|
|
|
.Times(1).WillOnce(ReturnDirEntries({}));
|
|
|
|
|
|
|
|
ReadDir("/mydir/mydir2/mydir3");
|
|
|
|
}
|