aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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;