libcryfs/test/fspp/fuse/createAndOpenFile/testutils/FuseCreateAndOpenTest.cpp

18 lines
486 B
C++
Raw Normal View History

2014-11-25 16:47:36 +01:00
#include "FuseCreateAndOpenTest.h"
using ::testing::_;
void FuseCreateAndOpenTest::CreateAndOpenFile(const char *filename, int flags) {
2014-11-25 16:47:36 +01:00
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();
2014-11-25 16:47:36 +01:00
}