libcryfs/test/fuse/rmdir/testutils/FuseRmdirTest.cpp
2015-02-17 00:48:49 +01:00

28 lines
606 B
C++

#include "FuseRmdirTest.h"
using ::testing::Action;
using ::testing::Invoke;
void FuseRmdirTest::Rmdir(const char *dirname) {
int error = RmdirReturnError(dirname);
EXPECT_EQ(0, error);
}
int FuseRmdirTest::RmdirReturnError(const char *dirname) {
auto fs = TestFS();
auto realpath = fs->mountDir() / dirname;
int retval = ::rmdir(realpath.c_str());
if (retval == 0) {
return 0;
} else {
return errno;
}
}
Action<void(const char*)> FuseRmdirTest::FromNowOnReturnDoesntExistOnLstat() {
return Invoke([this](const char *dirname) {
ReturnDoesntExistOnLstat(dirname);
});
}