2014-11-20 21:23:35 +01:00
|
|
|
#include "testutils/FuseOpenTest.h"
|
|
|
|
|
|
|
|
using ::testing::StrEq;
|
|
|
|
using ::testing::WithParamInterface;
|
|
|
|
using ::testing::Values;
|
2014-11-25 13:07:15 +01:00
|
|
|
using ::testing::Return;
|
2014-11-20 21:23:35 +01:00
|
|
|
|
|
|
|
class FuseOpenFlagsTest: public FuseOpenTest, public WithParamInterface<int> {
|
|
|
|
};
|
2019-10-13 14:16:06 +02:00
|
|
|
INSTANTIATE_TEST_SUITE_P(FuseOpenFlagsTest, FuseOpenFlagsTest, Values(O_RDWR, O_RDONLY, O_WRONLY));
|
2014-11-20 21:23:35 +01:00
|
|
|
|
|
|
|
TEST_P(FuseOpenFlagsTest, testFlags) {
|
|
|
|
ReturnIsFileOnLstat(FILENAME);
|
2018-12-03 07:57:21 +01:00
|
|
|
EXPECT_CALL(*fsimpl, openFile(StrEq(FILENAME), OpenFlagsEq(GetParam())))
|
2014-11-25 13:07:15 +01:00
|
|
|
.Times(1).WillOnce(Return(0));
|
2014-11-20 21:23:35 +01:00
|
|
|
|
|
|
|
OpenFile(FILENAME, GetParam());
|
|
|
|
}
|