2014-11-20 15:35:52 +01:00
|
|
|
#include "testutils/FuseLstatTest.h"
|
2014-11-20 15:27:01 +01:00
|
|
|
|
|
|
|
using ::testing::_;
|
2019-10-13 17:49:57 +02:00
|
|
|
using ::testing::Eq;
|
2016-02-14 01:54:36 +01:00
|
|
|
using ::testing::AtLeast;
|
2014-11-20 15:27:01 +01:00
|
|
|
|
|
|
|
class FuseLstatPathParameterTest: public FuseLstatTest {
|
|
|
|
};
|
|
|
|
|
|
|
|
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectRoot) {
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(Eq("/"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsDir);
|
2014-11-20 15:27:01 +01:00
|
|
|
LstatPath("/");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectSimpleFile) {
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(Eq("/myfile"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsFile);
|
2014-11-20 15:27:01 +01:00
|
|
|
LstatPath("/myfile");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectSimpleDir) {
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(Eq("/mydir"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsDir);
|
2014-11-20 15:27:01 +01:00
|
|
|
LstatPath("/mydir/");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectNestedFile) {
|
|
|
|
ReturnIsDirOnLstat("/mydir");
|
|
|
|
ReturnIsDirOnLstat("/mydir/mydir2");
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(Eq("/mydir/mydir2/myfile"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsFile);
|
2014-11-20 15:27:01 +01:00
|
|
|
LstatPath("/mydir/mydir2/myfile");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectNestedDir) {
|
|
|
|
ReturnIsDirOnLstat("/mydir");
|
|
|
|
ReturnIsDirOnLstat("/mydir/mydir2");
|
2019-10-13 17:49:57 +02:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(Eq("/mydir/mydir2/mydir3"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsDir);
|
2014-11-20 15:27:01 +01:00
|
|
|
LstatPath("/mydir/mydir2/mydir3/");
|
|
|
|
}
|