Changeset View
Changeset View
Standalone View
Standalone View
head/tests/sys/fs/fusefs/xattr.cc
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | if (verbosity > 1) | ||||
printf("Killing! pid %d\n", pid); | printf("Killing! pid %d\n", pid); | ||||
kill(pid, SIGINT); | kill(pid, SIGINT); | ||||
return(NULL); | return(NULL); | ||||
} | } | ||||
class Xattr: public FuseTest { | class Xattr: public FuseTest { | ||||
public: | public: | ||||
void expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r) | |||||
{ | |||||
EXPECT_CALL(*m_mock, process( | |||||
ResultOf([=](auto in) { | |||||
const char *a = (const char*)in.body.bytes + | |||||
sizeof(fuse_getxattr_in); | |||||
return (in.header.opcode == FUSE_GETXATTR && | |||||
in.header.nodeid == ino && | |||||
0 == strcmp(attr, a)); | |||||
}, Eq(true)), | |||||
_) | |||||
).WillOnce(Invoke(r)); | |||||
} | |||||
void expect_listxattr(uint64_t ino, uint32_t size, ProcessMockerT r, | void expect_listxattr(uint64_t ino, uint32_t size, ProcessMockerT r, | ||||
Sequence *seq = NULL) | Sequence *seq = NULL) | ||||
{ | { | ||||
if (seq == NULL) { | if (seq == NULL) { | ||||
EXPECT_CALL(*m_mock, process( | EXPECT_CALL(*m_mock, process( | ||||
ResultOf([=](auto in) { | ResultOf([=](auto in) { | ||||
return (in.header.opcode == FUSE_LISTXATTR && | return (in.header.opcode == FUSE_LISTXATTR && | ||||
in.header.nodeid == ino && | in.header.nodeid == ino && | ||||
▲ Show 20 Lines • Show All 773 Lines • Show Last 20 Lines |