aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-02-10 19:36:35 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:12 +0200
commita9a7ecaa25e6bc11062e21affd458e2de78747ff (patch)
treec14a4e269cbf46163cf334781a5925d052e72aa1 /tests
parent64df3de50aa88f15e1a46f21a0f62281eb582603 (diff)
Fix put not working because used time discards message before received
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index a685ee6..5e53dc8 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -2,7 +2,11 @@
#include "../include/Database.hpp"
#include "../include/Group.hpp"
#include "../include/LocalUser.hpp"
+#include <chrono>
+#include <thread>
+using namespace std;
+using namespace chrono_literals;
using namespace odhtdb;
int main()
@@ -14,6 +18,7 @@ int main()
std::string privateKeyStr = localUser->getPrivateKey().toString();
printf("Local user private key: %s\n", privateKeyStr.c_str());
+
/*
char hex_ed_pk[65];
unsigned char seed[crypto_sign_ed25519_SEEDBYTES];
@@ -27,21 +32,24 @@ int main()
*/
- //crypto_sign_ed25519_sk_to_seed
// TODO: For tests, dont run against bootstrap.ring.cx.
// Run against a bootstrap node made only for testing which doesn't persist added data.
- /*
+
Database database("bootstrap.ring.cx", 4222, "storage");
database.seed();
- LocalUser *localUser = LocalUser::create("dec05eba");
Group group("admin");
group.addUser(localUser);
database.create("galax.channel.latenight.chat", &group);
- const char *data = "hello, world!";
- database.add("galax.channel.latenight.chat", DataView{ (void*)data, strlen(data) });
+ //const char *data = "hello, world!";
+ //database.add("galax.channel.latenight.chat", DataView{ (void*)data, strlen(data) });
database.commit();
- */
+ auto start = chrono::high_resolution_clock::now();
+ while(chrono::high_resolution_clock::now() - start < 5s)
+ {
+ this_thread::sleep_for(10ms);
+ }
+
return 0;
}