aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-02-01 21:15:13 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:12 +0200
commit1c7e6e074155499155adbbb651db1c66f1762ba2 (patch)
treec08a95e772c8e23228a2be78e308aba313034f26 /tests
parentbd2bd91ac947a7b1f6d097d7efa4b0ab2041d4db (diff)
Sync time with ntp server, starting with basic operations
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
new file mode 100644
index 0000000..2618d18
--- /dev/null
+++ b/tests/main.cpp
@@ -0,0 +1,24 @@
+#include <vector>
+#include "../include/Database.hpp"
+#include "../include/Group.hpp"
+#include "../include/LocalUser.hpp"
+
+using namespace odhtdb;
+
+int main()
+{
+ // 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);
+
+ 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) });
+ database.commit();
+ return 0;
+} \ No newline at end of file