aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-05-01 14:57:29 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-05-01 14:57:32 +0200
commitb0cc417bc9289fdd5c98028136e37c6a6ee62944 (patch)
treebb1646b4436d56bc10e103af0c03e157670f32fd /tests
parent8da5ba7f057978b224868028679cbda9e11089ab (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;