summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-09-09 20:49:42 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2020-09-09 20:49:42 +0100
commit3606662bbe5a8ff38220ecbc4d7d927a231f8a2f (patch)
tree4e63aad80fbb853798788ad440d7b0d215125efd
parentAdd the HideUnknown mapper (diff)
downloadnetfs-3606662bbe5a8ff38220ecbc4d7d927a231f8a2f.tar.bz2
netfs-3606662bbe5a8ff38220ecbc4d7d927a231f8a2f.tar.xz
netfs-3606662bbe5a8ff38220ecbc4d7d927a231f8a2f.zip
Add test for Group::hasMember
-rw-r--r--netfs/unittests/testLib.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/netfs/unittests/testLib.cpp b/netfs/unittests/testLib.cpp
index 14ea71f..ba3ef44 100644
--- a/netfs/unittests/testLib.cpp
+++ b/netfs/unittests/testLib.cpp
@@ -50,3 +50,18 @@ BOOST_DATA_TEST_CASE(foundname, GoodNames ^ GoodIds, name, id)
}
BOOST_AUTO_TEST_SUITE_END();
+
+BOOST_AUTO_TEST_CASE(group_membership)
+{
+ Group g(0, "root");
+ g.members.insert(0);
+ g.members.insert(1);
+ g.members.insert(5);
+
+ BOOST_REQUIRE_EQUAL(3, g.members.size());
+ BOOST_CHECK(g.hasMember(0));
+ BOOST_CHECK(g.hasMember(1));
+ BOOST_CHECK(g.hasMember(5));
+ BOOST_CHECK(!g.hasMember(3));
+ BOOST_CHECK(!g.hasMember(6));
+}