diff options
-rw-r--r-- | netfs/unittests/testLib.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/netfs/unittests/testLib.cpp b/netfs/unittests/testLib.cpp index ba3ef44..2985c93 100644 --- a/netfs/unittests/testLib.cpp +++ b/netfs/unittests/testLib.cpp @@ -65,3 +65,28 @@ BOOST_AUTO_TEST_CASE(group_membership) BOOST_CHECK(!g.hasMember(3)); BOOST_CHECK(!g.hasMember(6)); } + +// These tests make some assumptions about local system users +BOOST_FIXTURE_TEST_CASE(usercache, EntCache<User>) +{ + auto root = getEntry(0); + BOOST_REQUIRE(root); + BOOST_CHECK_EQUAL(root->id, 0); + BOOST_CHECK_EQUAL(root->name, "root"); + BOOST_CHECK_EQUAL(root->group, 0); + + auto rootByName = getEntry(root->name); + BOOST_REQUIRE_EQUAL(root, rootByName); +} + +BOOST_FIXTURE_TEST_CASE(groupcache, EntCache<Group>) +{ + auto root = getEntry(0); + BOOST_REQUIRE(root); + BOOST_CHECK_EQUAL(root->id, 0); + BOOST_CHECK_EQUAL(root->name, "root"); + BOOST_CHECK(root->hasMember(0)); + + auto rootByName = getEntry(root->name); + BOOST_REQUIRE_EQUAL(root, rootByName); +} |