summaryrefslogtreecommitdiff
path: root/netfs/unittests/testDaemon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netfs/unittests/testDaemon.cpp')
-rw-r--r--netfs/unittests/testDaemon.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/netfs/unittests/testDaemon.cpp b/netfs/unittests/testDaemon.cpp
new file mode 100644
index 0000000..5c6fbc9
--- /dev/null
+++ b/netfs/unittests/testDaemon.cpp
@@ -0,0 +1,28 @@
+#define BOOST_TEST_MODULE TestNetFSDaemon
+#include <boost/test/data/test_case.hpp>
+#include <boost/test/unit_test.hpp>
+
+#include <entCache.h>
+#include <exceptions.h>
+#include <modeCheck.h>
+
+struct ModeCheckHelper {
+ EntryResolverPtr<User> eru = std::make_shared<UserEntCache>();
+ EntryResolverPtr<Group> erg = std::make_shared<GroupEntCache>(eru);
+};
+
+BOOST_FIXTURE_TEST_SUITE(mc, ModeCheckHelper)
+
+BOOST_AUTO_TEST_CASE(mode_check_valid)
+{
+ ModeCheck mc {{"root", "root"}, "/tmp", *eru, *erg};
+}
+
+BOOST_AUTO_TEST_CASE(mode_check_invalid)
+{
+ BOOST_CHECK_THROW({ ModeCheck({"root", ""}, "/tmp", *eru, *erg); }, NetFS::SystemError);
+ BOOST_CHECK_THROW({ ModeCheck({"", "root"}, "/tmp", *eru, *erg); }, NetFS::SystemError);
+ BOOST_CHECK_THROW({ ModeCheck({"", ""}, "/tmp", *eru, *erg); }, NetFS::SystemError);
+}
+
+BOOST_AUTO_TEST_SUITE_END()