aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-01 14:57:29 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit9197a6118d810356263e92cbb48c406f8e3d3a05 (patch)
tree394460d2e84cd4972af745aecf110228168427d1 /tests
parent98544090819faf40ff56eca83cd24bad3d386caa (diff)
Update ntp dependency with bug fix, make error messages better
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 7e8f489..104c9b8 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -129,6 +129,18 @@ void testCachedIdentity()
printf("Certificate data size: %d, serialized data: %s\n", certificateData.size(), Hash(certificateData.data(), certificateData.size()).toString().c_str());
}
+void testTimestamp(const Database &database)
+{
+ auto timestamp1 = database.getSyncedTimestampUtc();
+ this_thread::sleep_for(chrono::milliseconds(100));
+ auto timestamp2 = database.getSyncedTimestampUtc();
+
+ if(timestamp2.getCombined() > timestamp1.getCombined())
+ Log::debug("Second timestamp is more than first one, as expected");
+ else
+ fail("Second timestamp is not more than first one for some reason");
+}
+
int main()
{
Log::debug("Starting tests...");
@@ -143,6 +155,8 @@ int main()
// TODO: Setup local bootstrap node for tests
Database database("bootstrap.ring.cx", 4222, "storage");
+ testTimestamp(database);
+
int createNodeCounter = 0;
int addDataCounter = 0;
int addUserCounter = 0;