From c0574f16ca7960a3301230ba36ba96148818e229 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 16 May 2018 05:29:39 +0200 Subject: Add method to get user groups --- tests/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/main.cpp b/tests/main.cpp index 5374c2d..dd56164 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -241,6 +241,14 @@ int main() database.storeUserWithoutNodes("anotherUser", password); if(!database.doesStoredUserExist("anotherUser")) fail("Added user 'anotherUser' to database without any nodes, but it doesn't seem to be stored"); + + auto adminUserGroups = database.getUserGroups(*databaseNode.getRequestHash(), adminUserKey->getPublicKey()); + if(adminUserGroups.size() != 1 || adminUserGroups[0].getView() != databaseCreateResponse->getNodeAdminGroupId()->getView()) + fail("Admin group doesn't match group stored in database"); + + auto userGroups = database.getUserGroups(*databaseNode.getRequestHash(), localUserKeyPair.getPublicKey()); + if(userGroups.size() != 1 || userGroups[0].getView() != databaseCreateResponse->getNodeAdminGroupId()->getView()) + fail("User group doesn't match group stored in database"); } Log::debug("Callback works when adding data while connected, now testing to reconnect and check if data remains..."); { -- cgit v1.2.3