diff options
Diffstat (limited to 'netfs/unittests/mockFuse.h')
-rw-r--r-- | netfs/unittests/mockFuse.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/netfs/unittests/mockFuse.h b/netfs/unittests/mockFuse.h new file mode 100644 index 0000000..3ca88fe --- /dev/null +++ b/netfs/unittests/mockFuse.h @@ -0,0 +1,39 @@ +#ifndef MOCKFUSE_H +#define MOCKFUSE_H + +#include <fuseApp.h> + +class FuseMock : public NetFS::FuseApp { + public: + FuseMock(const std::string &, int & argc, char ** argv); + + struct fuse_context * fuse_get_context() override; + int fuse_opt_parse(struct fuse_args * args, void * data, const struct fuse_opt [], fuse_opt_proc_t proc) override; + int main(int &, char **, const struct fuse_operations * o) override; + + fuse_operations ops; + + protected: + virtual NetFS::Client::ConfigurationPtr ReadConfiguration(const std::string &) const override; + + private: + const std::string testEndpoint; + fuse_context context; +}; + +class FuseMockHost { + public: + FuseMockHost(const std::string &, int c, char ** v); + ~FuseMockHost(); + + private: + int argc; + FuseMock * app; + + public: + fuse_operations * fuse; +}; + + +#endif + |