2014-11-25 16:47:36 +01:00
|
|
|
#include "FuseCreateAndOpenTest.h"
|
|
|
|
|
|
|
|
using ::testing::_;
|
|
|
|
|
2017-08-25 01:14:16 +02:00
|
|
|
void FuseCreateAndOpenTest::CreateAndOpenFile(const char *filename, int flags) {
|
2014-11-25 16:47:36 +01:00
|
|
|
auto fs = TestFS();
|
|
|
|
|
|
|
|
auto realpath = fs->mountDir() / filename;
|
2017-08-25 01:14:16 +02:00
|
|
|
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
|
|
|
}
|