Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/fs/fusefs/utils.cc
Show First 20 Lines • Show All 361 Lines • ▼ Show 20 Lines | void FuseTest::expect_opendir(uint64_t ino) | ||||
).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { | ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { | ||||
out.header.len = sizeof(out.header); | out.header.len = sizeof(out.header); | ||||
SET_OUT_HEADER_LEN(out, open); | SET_OUT_HEADER_LEN(out, open); | ||||
out.body.open.fh = FH; | out.body.open.fh = FH; | ||||
}))); | }))); | ||||
} | } | ||||
void FuseTest::expect_read(uint64_t ino, uint64_t offset, uint64_t isize, | void FuseTest::expect_read(uint64_t ino, uint64_t offset, uint64_t isize, | ||||
uint64_t osize, const void *contents, int flags) | uint64_t osize, const void *contents, int flags, uint64_t fh) | ||||
{ | { | ||||
EXPECT_CALL(*m_mock, process( | EXPECT_CALL(*m_mock, process( | ||||
ResultOf([=](auto in) { | ResultOf([=](auto in) { | ||||
return (in.header.opcode == FUSE_READ && | return (in.header.opcode == FUSE_READ && | ||||
in.header.nodeid == ino && | in.header.nodeid == ino && | ||||
in.body.read.fh == FH && | in.body.read.fh == fh && | ||||
in.body.read.offset == offset && | in.body.read.offset == offset && | ||||
in.body.read.size == isize && | in.body.read.size == isize && | ||||
(flags == -1 ? | (flags == -1 ? | ||||
(in.body.read.flags == O_RDONLY || | (in.body.read.flags == O_RDONLY || | ||||
in.body.read.flags == O_RDWR) | in.body.read.flags == O_RDWR) | ||||
: in.body.read.flags == (uint32_t)flags)); | : in.body.read.flags == (uint32_t)flags)); | ||||
}, Eq(true)), | }, Eq(true)), | ||||
_) | _) | ||||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |