aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 4d3bcc3..9992eee 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -1,4 +1,5 @@
#include "assert.hpp"
+#include "../include/Log.hpp"
#include "../include/Database.hpp"
#include "../include/Group.hpp"
#include "../include/LocalUser.hpp"
@@ -16,16 +17,16 @@ void testHash()
{
Hash hash("odhtdb", 6);
assertEquals<string>("a7b30ec8ab92de60e551b26bb8f78d315697f84dd7f5549a143477e095ec934f", hash.toString());
- printf("hash of 'odhtdb' is: a7b30ec8ab92de60e551b26bb8f78d315697f84dd7f5549a143477e095ec934f\n");
+ Log::debug("hash of 'odhtdb' is: a7b30ec8ab92de60e551b26bb8f78d315697f84dd7f5549a143477e095ec934f\n");
}
void testSignData(LocalUser *localUser)
{
std::string publicKeyStr = localUser->getPublicKey().toString();
- printf("Local user public key: %s\n", publicKeyStr.c_str());
+ Log::debug("Local user public key: %s\n", publicKeyStr.c_str());
std::string privateKeyStr = localUser->getPrivateKey().toString();
- printf("Local user private key: %s\n", privateKeyStr.c_str());
+ Log::debug("Local user private key: %s\n", privateKeyStr.c_str());
string expectedUnsignedData = "hello, world!";
string signedData = localUser->getPrivateKey().sign(DataView((void*)expectedUnsignedData.data(), expectedUnsignedData.size()));
@@ -82,7 +83,7 @@ void testEncryption()
int main()
{
- printf("Starting tests...\n");
+ Log::debug("Starting tests...\n");
LocalUser *localUser = LocalUser::create(Signature::KeyPair(), "dec05eba", nullptr);
testSignData(localUser);
testEncryption();