Loading tests/test_backend.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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; Loading @@ -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"); } Loading Loading
tests/test_backend.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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; Loading @@ -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"); } Loading