diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-04-28 10:44:11 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-04-28 10:44:22 +0200 |
commit | 54d8ae4c335c21290dc41e5ba4701b3c19bba601 (patch) | |
tree | f381e10e071e1800e8e5ca69701fe25e58dbd837 /tests | |
parent | 166e132873fccf62327d2190fe1d827d89a5db63 (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; } |