Commit 1a6e51cf authored by jan.koester's avatar jan.koester
Browse files

test

parent c9746f33
Loading
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -13,8 +13,14 @@
#include <string>
#include <vector>
#include <uuidp.h>
#ifdef _MSC_VER
#include <io.h>
#define getpid _getpid
#define unlink _unlink
#else
#include <unistd.h>
#include <sys/stat.h>
#endif

#include "backend.h"
#include "authdb.h"
@@ -27,6 +33,10 @@
#include "client.h"
#include "cluster.h"

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

namespace authdb { std::mutex AuthClientLock; }

using authdb::AuthBackend;
@@ -43,7 +53,11 @@ protected:
    AuthBackend *backend = nullptr;

    void SetUp() override {
#ifdef _MSC_VER
        dbPath = "C:\\temp\\authdb_test_backend_" + std::to_string(getpid()) + ".db";
#else
        dbPath = "/tmp/authdb_test_backend_" + std::to_string(getpid()) + ".db";
#endif
        backend = new AuthBackend(authdb::File, dbPath, "testdomain");
    }