libcryfs/test/fspp/fuse/createAndOpenFile/testutils/FuseCreateAndOpenTest.cpp
2017-08-25 00:14:16 +01:00

18 lines
486 B
C++

#include "FuseCreateAndOpenTest.h"
using ::testing::_;
void FuseCreateAndOpenTest::CreateAndOpenFile(const char *filename, int flags) {
auto fs = TestFS();
auto realpath = fs->mountDir() / filename;
OpenFileHandle fd(realpath.c_str(), flags | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
EXPECT_GE(fd.fd(), 0);
}
int FuseCreateAndOpenTest::CreateAndOpenFileReturnError(const char *filename, int flags) {
OpenFileHandle fd(filename, flags);
return fd.errorcode();
}