libcryfs/test/fspp/fuse/rename/testutils/FuseRenameTest.cpp
Sebastian Messmer cc7b38b3c1 - run-clang-tidy.sh also runs on test cases.
- fix clang-tidy warnings in test cases
2017-12-01 15:01:49 +00:00

21 lines
467 B
C++

#include "FuseRenameTest.h"
void FuseRenameTest::Rename(const char *from, const char *to) {
int error = RenameReturnError(from, to);
EXPECT_EQ(0, error);
}
int FuseRenameTest::RenameReturnError(const char *from, const char *to) {
auto fs = TestFS();
auto realfrom = fs->mountDir() / from;
auto realto = fs->mountDir() / to;
int retval = ::rename(realfrom.c_str(), realto.c_str());
if (0 == retval) {
return 0;
} else {
return errno;
}
}