aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp17
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;
}