libcryfs/test/fspp/fuse/access/testutils/FuseAccessTest.cpp
Sebastian Messmer 9ccb006f61 - Switch some CI jobs to clang 15
- Fix clang-tidy warnings from Clang 15
2023-07-08 14:48:59 -07:00

19 lines
458 B
C++

#include "FuseAccessTest.h"
void FuseAccessTest::AccessFile(const char *filename, int mode) {
const int error = AccessFileReturnError(filename, mode);
EXPECT_EQ(0, error);
}
int FuseAccessTest::AccessFileReturnError(const char *filename, int mode) {
auto fs = TestFS();
auto realpath = fs->mountDir() / filename;
const int retval = ::access(realpath.string().c_str(), mode);
if (retval == 0) {
return 0;
} else {
return errno;
}
}