From 9197a6118d810356263e92cbb48c406f8e3d3a05 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 1 May 2018 14:57:29 +0200 Subject: Update ntp dependency with bug fix, make error messages better --- tests/main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') 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; -- cgit v1.2.3