2014-11-20 15:35:52 +01:00
|
|
|
#include "testutils/FuseLstatTest.h"
|
2014-11-20 15:27:01 +01:00
|
|
|
|
|
|
|
using ::testing::_;
|
|
|
|
using ::testing::StrEq;
|
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) {
|
2018-12-03 07:57:21 +01:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(StrEq("/"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsDir);
|
2014-11-20 15:27:01 +01:00
|
|
|
LstatPath("/");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectSimpleFile) {
|
2018-12-03 07:57:21 +01:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(StrEq("/myfile"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsFile);
|
2014-11-20 15:27:01 +01:00
|
|
|
LstatPath("/myfile");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(FuseLstatPathParameterTest, PathParameterIsCorrectSimpleDir) {
|
2018-12-03 07:57:21 +01:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(StrEq("/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");
|
2018-12-03 07:57:21 +01:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(StrEq("/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");
|
2018-12-03 07:57:21 +01:00
|
|
|
EXPECT_CALL(*fsimpl, lstat(StrEq("/mydir/mydir2/mydir3"), _)).Times(AtLeast(1)).WillRepeatedly(ReturnIsDir);
|
2014-11-20 15:27:01 +01:00
|
|
|
LstatPath("/mydir/mydir2/mydir3/");
|
|
|
|
}
|