Added mtime/ctime tests
This commit is contained in:
parent
32b552dd6b
commit
7055cd295d
33
src/test/fspp/fuse/lstat/FuseLstatReturnCtimeTest.cpp
Normal file
33
src/test/fspp/fuse/lstat/FuseLstatReturnCtimeTest.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#include "testutils/FuseLstatReturnTest.h"
|
||||||
|
|
||||||
|
class FuseLstatReturnCtimeTest: public FuseLstatReturnTest<time_t> {
|
||||||
|
public:
|
||||||
|
const time_t CTIME1 = 0;
|
||||||
|
const time_t CTIME2 = 100;
|
||||||
|
const time_t CTIME3 = 1416496809; // current timestamp as of writing the test
|
||||||
|
const time_t CTIME4 = 32503680000; // needs a 64bit timestamp
|
||||||
|
private:
|
||||||
|
void set(struct stat *stat, time_t value) override {
|
||||||
|
stat->st_ctime = value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_F(FuseLstatReturnCtimeTest, ReturnedFileCtimeIsCorrect1) {
|
||||||
|
struct ::stat result = CallFileLstatWithValue(CTIME1);
|
||||||
|
EXPECT_EQ(CTIME1, result.st_ctime);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(FuseLstatReturnCtimeTest, ReturnedFileCtimeIsCorrect2) {
|
||||||
|
struct ::stat result = CallFileLstatWithValue(CTIME2);
|
||||||
|
EXPECT_EQ(CTIME2, result.st_ctime);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(FuseLstatReturnCtimeTest, ReturnedFileCtimeIsCorrect3) {
|
||||||
|
struct ::stat result = CallFileLstatWithValue(CTIME3);
|
||||||
|
EXPECT_EQ(CTIME3, result.st_ctime);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(FuseLstatReturnCtimeTest, ReturnedFileCtimeIsCorrect4) {
|
||||||
|
struct ::stat result = CallFileLstatWithValue(CTIME4);
|
||||||
|
EXPECT_EQ(CTIME4, result.st_ctime);
|
||||||
|
}
|
33
src/test/fspp/fuse/lstat/FuseLstatReturnMtimeTest.cpp
Normal file
33
src/test/fspp/fuse/lstat/FuseLstatReturnMtimeTest.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#include "testutils/FuseLstatReturnTest.h"
|
||||||
|
|
||||||
|
class FuseLstatReturnMtimeTest: public FuseLstatReturnTest<time_t> {
|
||||||
|
public:
|
||||||
|
const time_t MTIME1 = 0;
|
||||||
|
const time_t MTIME2 = 100;
|
||||||
|
const time_t MTIME3 = 1416496809; // current timestamp as of writing the test
|
||||||
|
const time_t MTIME4 = 32503680000; // needs a 64bit timestamp
|
||||||
|
private:
|
||||||
|
void set(struct stat *stat, time_t value) override {
|
||||||
|
stat->st_mtime = value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_F(FuseLstatReturnMtimeTest, ReturnedFileMtimeIsCorrect1) {
|
||||||
|
struct ::stat result = CallFileLstatWithValue(MTIME1);
|
||||||
|
EXPECT_EQ(MTIME1, result.st_mtime);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(FuseLstatReturnMtimeTest, ReturnedFileMtimeIsCorrect2) {
|
||||||
|
struct ::stat result = CallFileLstatWithValue(MTIME2);
|
||||||
|
EXPECT_EQ(MTIME2, result.st_mtime);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(FuseLstatReturnMtimeTest, ReturnedFileMtimeIsCorrect3) {
|
||||||
|
struct ::stat result = CallFileLstatWithValue(MTIME3);
|
||||||
|
EXPECT_EQ(MTIME3, result.st_mtime);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(FuseLstatReturnMtimeTest, ReturnedFileMtimeIsCorrect4) {
|
||||||
|
struct ::stat result = CallFileLstatWithValue(MTIME4);
|
||||||
|
EXPECT_EQ(MTIME4, result.st_mtime);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user