summaryrefslogtreecommitdiff
path: root/netfs/unittests/mockMount.h
diff options
context:
space:
mode:
Diffstat (limited to 'netfs/unittests/mockMount.h')
-rw-r--r--netfs/unittests/mockMount.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/netfs/unittests/mockMount.h b/netfs/unittests/mockMount.h
new file mode 100644
index 0000000..38fb2ee
--- /dev/null
+++ b/netfs/unittests/mockMount.h
@@ -0,0 +1,36 @@
+#ifndef MOCKMOUNT_H
+#define MOCKMOUNT_H
+
+#include "mockDaemon.h"
+#include <definedDirs.h>
+#include <fuseApp.h>
+#include <memory>
+#include <thread>
+#include <visibility.h>
+
+inline const std::filesystem::path mntpnt {binDir / "mnt"};
+
+class DLL_PUBLIC FuseMountPoint : public MockDaemonHost, public NetFS::FuseApp {
+public:
+ FuseMountPoint();
+
+ void start();
+
+ ~FuseMountPoint() override;
+
+ void stop();
+
+ SPECIAL_MEMBERS_DELETE(FuseMountPoint);
+
+ struct fuse_context * fuse_get_context() override;
+
+ static char * vstrdupf(const char * fmt, va_list args);
+
+ void vlogf(int, const char * fmt, va_list args) const noexcept override;
+
+ struct fuse * fs;
+ struct fuse_args fargs;
+ std::unique_ptr<std::thread> th;
+};
+
+#endif