diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-09-09 20:49:42 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-09-09 20:49:42 +0100 |
commit | 3606662bbe5a8ff38220ecbc4d7d927a231f8a2f (patch) | |
tree | 4e63aad80fbb853798788ad440d7b0d215125efd | |
parent | Add the HideUnknown mapper (diff) | |
download | netfs-3606662bbe5a8ff38220ecbc4d7d927a231f8a2f.tar.bz2 netfs-3606662bbe5a8ff38220ecbc4d7d927a231f8a2f.tar.xz netfs-3606662bbe5a8ff38220ecbc4d7d927a231f8a2f.zip |
Add test for Group::hasMember
-rw-r--r-- | netfs/unittests/testLib.cpp | 15 |
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)); +} |