Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/fs/fusefs/utils.cc
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | ).WillOnce(Invoke( ReturnImmediate([&](auto in, auto& out) { | ||||
m_mock->m_quit = true; | m_mock->m_quit = true; | ||||
out.header.len = sizeof(out.header); | out.header.len = sizeof(out.header); | ||||
out.header.unique = in.header.unique; | out.header.unique = in.header.unique; | ||||
out.header.error = -error; | out.header.error = -error; | ||||
}))); | }))); | ||||
} | } | ||||
void | void | ||||
FuseTest::expect_fallocate(uint64_t ino, uint64_t offset, uint64_t length, | |||||
uint32_t mode, int error, int times) | |||||
{ | |||||
EXPECT_CALL(*m_mock, process( | |||||
ResultOf([=](auto in) { | |||||
return (in.header.opcode == FUSE_FALLOCATE && | |||||
in.header.nodeid == ino && | |||||
in.body.fallocate.offset == offset && | |||||
in.body.fallocate.length == length && | |||||
in.body.fallocate.mode == mode); | |||||
}, Eq(true)), | |||||
_) | |||||
).Times(times) | |||||
.WillRepeatedly(Invoke(ReturnErrno(error))); | |||||
} | |||||
void | |||||
FuseTest::expect_flush(uint64_t ino, int times, ProcessMockerT r) | FuseTest::expect_flush(uint64_t ino, int times, ProcessMockerT r) | ||||
{ | { | ||||
EXPECT_CALL(*m_mock, process( | EXPECT_CALL(*m_mock, process( | ||||
ResultOf([=](auto in) { | ResultOf([=](auto in) { | ||||
return (in.header.opcode == FUSE_FLUSH && | return (in.header.opcode == FUSE_FLUSH && | ||||
in.header.nodeid == ino); | in.header.nodeid == ino); | ||||
}, Eq(true)), | }, Eq(true)), | ||||
_) | _) | ||||
▲ Show 20 Lines • Show All 423 Lines • Show Last 20 Lines |