Fix Mock file system setup on Mac OS X

This commit is contained in:
Sebastian Messmer 2016-02-14 01:01:59 +01:00
parent 5363a397f8
commit 33c950e978

View File

@ -19,6 +19,7 @@ MockFilesystem::~MockFilesystem() {}
FuseTest::FuseTest(): fsimpl() {
auto defaultAction = Throw(FuseErrnoException(EIO));
auto successAction = Return();
ON_CALL(fsimpl, openFile(_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, closeFile(_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, lstat(_,_)).WillByDefault(defaultAction);
@ -29,7 +30,7 @@ FuseTest::FuseTest(): fsimpl() {
ON_CALL(fsimpl, write(_,_,_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, fsync(_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, fdatasync(_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, access(_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, access(_,_)).WillByDefault(successAction);
ON_CALL(fsimpl, createAndOpenFile(_,_,_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, mkdir(_,_,_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, rmdir(_)).WillByDefault(defaultAction);
@ -37,7 +38,9 @@ FuseTest::FuseTest(): fsimpl() {
ON_CALL(fsimpl, rename(_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, readDir(_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, utimens(_,_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, statfs(_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, statfs(_,_)).WillByDefault(Invoke([](const char *path, struct statvfs *result) {
::statvfs("/", result); // As dummy value take the values from the root filesystem
}));
ON_CALL(fsimpl, chmod(_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, chown(_,_,_)).WillByDefault(defaultAction);
ON_CALL(fsimpl, createSymlink(_,_,_,_)).WillByDefault(defaultAction);