diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-08-27 20:48:27 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-09-01 20:02:59 +0100 |
commit | 720b701fac13f464addb2116301d9a9a2998d041 (patch) | |
tree | e25f2d1b37684fbd0896825ba846a1813b6263ab /test/test-util.hpp | |
parent | e93b2fe92eb172d7c7b76209bf489d9c0da59cca (diff) | |
download | webstat-720b701fac13f464addb2116301d9a9a2998d041.tar.bz2 webstat-720b701fac13f464addb2116301d9a9a2998d041.tar.xz webstat-720b701fac13f464addb2116301d9a9a2998d041.zip |
Add MockDBPool
Feels like this should be provided by libdbpp, but it isn't.
Diffstat (limited to 'test/test-util.hpp')
-rw-r--r-- | test/test-util.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/test-util.hpp b/test/test-util.hpp index 20020f8..5b2a968 100644 --- a/test/test-util.hpp +++ b/test/test-util.hpp @@ -1,7 +1,8 @@ #pragma once -#include "pq-mock.h" +#include <connectionPool.h> #include <filesystem> +#include <pq-mock.h> namespace WebStat { #define XSTR(s) STR(s) @@ -20,5 +21,16 @@ namespace WebStat { MockDB(); }; + class MockDBPool : public DB::BasicConnectionPool { + public: + MockDBPool(std::string); + + protected: + DB::ConnectionPtr createResource() const; + + private: + std::string name; + }; + template<typename Out> using ParseData = std::tuple<std::string_view, Out>; } |