aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleksi Lindeman <0xdec05eba@gmail.com>2018-02-10 19:36:35 +0100
committerAleksi Lindeman <0xdec05eba@gmail.com>2018-02-10 19:36:44 +0100
commitf24cd8b5708bdaf538508bfbca837299cecfba5b (patch)
treeb17e21cd3718d1e89e774f2b3858656191b3a52a /tests
parent4f7b60a1db9db8bf27720abd23ec3cc5fbfddf48 (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;
}