File: FuseOpenFlagsTest.cpp

package info (click to toggle)
cryfs 1.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,404 kB
  • sloc: cpp: 150,188; asm: 10,493; python: 1,455; javascript: 65; sh: 50; makefile: 17; xml: 7
file content (18 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "testutils/FuseOpenTest.h"

using ::testing::Eq;
using ::testing::WithParamInterface;
using ::testing::Values;
using ::testing::Return;

class FuseOpenFlagsTest: public FuseOpenTest, public WithParamInterface<int> {
};
INSTANTIATE_TEST_SUITE_P(FuseOpenFlagsTest, FuseOpenFlagsTest, Values(O_RDWR, O_RDONLY, O_WRONLY));

TEST_P(FuseOpenFlagsTest, testFlags) {
  ReturnIsFileOnLstat(FILENAME);
  EXPECT_CALL(*fsimpl, openFile(Eq(FILENAME), OpenFlagsEq(GetParam())))
    .Times(1).WillOnce(Return(0));

  OpenFile(FILENAME, GetParam());
}