aboutsummaryrefslogtreecommitdiff
path: root/tests/assert.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-03-05 22:45:56 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commiteda9a7bbefc5587bf1ff895a9214f450e64575fa (patch)
tree0f968fb7373a29cf116b4b6d473a966e28e62825 /tests/assert.hpp
parent33e823ddddddd4a13b1a05b90ae5b419b89bcb1d (diff)
Implement 'create' operation, add seeding
Seeding is currently only done on the key you specify, in the future the user should request data that it can seed.
Diffstat (limited to 'tests/assert.hpp')
-rw-r--r--tests/assert.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/assert.hpp b/tests/assert.hpp
new file mode 100644
index 0000000..86f74f2
--- /dev/null
+++ b/tests/assert.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <cstdlib>
+#include <iostream>
+
+template <typename T>
+static void assertEquals(const T &expected, const T &actual)
+{
+ if(expected != actual)
+ {
+ std::cerr << "Assertion failed!\nExpected: " << expected << ", actual: " << actual << std::endl;
+ exit(1);
+ }
+}
+
+static void fail(const std::string &errMsg)
+{
+ fprintf(stderr, "Fail:\n%.*s\n", errMsg.size(), errMsg.c_str());
+ exit(1);
+}