diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-28 10:44:11 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | fb447b94e369114df0bc96b5c4c20b2cd102bff0 (patch) | |
tree | 1dac4f99a3feeb06e94b744163f8dfadb7616245 /tests | |
parent | 2ecdfb3b47882411659a0efe451b0910c85a32f5 (diff) |
Add decryption (and caching) of data, even when adding encryption key after data has been added
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/main.cpp b/tests/main.cpp index af3cf8d..7e8f489 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -143,19 +143,26 @@ int main() // TODO: Setup local bootstrap node for tests Database database("bootstrap.ring.cx", 4222, "storage"); - database.setOnCreateNodeCallback([](const DatabaseCreateNodeRequest &request) + int createNodeCounter = 0; + int addDataCounter = 0; + int addUserCounter = 0; + + database.setOnCreateNodeCallback([&createNodeCounter](const DatabaseCreateNodeRequest &request) { Log::debug("Create node callback"); + ++createNodeCounter; }); - database.setOnAddNodeCallback([](const DatabaseAddNodeRequest &request) + database.setOnAddNodeCallback([&addDataCounter](const DatabaseAddNodeRequest &request) { Log::debug("Add node callback"); + ++addDataCounter; }); - database.setOnAddUserCallback([](const DatabaseAddUserRequest &request) + database.setOnAddUserCallback([&addUserCounter](const DatabaseAddUserRequest &request) { Log::debug("Add user callback"); + ++addUserCounter; }); auto databaseCreateResponse = database.create("adminUserName", "latenight"); @@ -174,5 +181,9 @@ int main() this_thread::sleep_for(10ms); } + assertEquals(1, createNodeCounter); + assertEquals(2, addDataCounter); + assertEquals(1, addUserCounter); + return 0; } |