diff options
Diffstat (limited to 'tests/test-compiledsql.cpp')
-rw-r--r-- | tests/test-compiledsql.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/test-compiledsql.cpp b/tests/test-compiledsql.cpp new file mode 100644 index 0000000..4fe29e0 --- /dev/null +++ b/tests/test-compiledsql.cpp @@ -0,0 +1,57 @@ +#include <gtest/gtest.h> + +#include <filesystem> +#include <memory> +#include <string> +#include <system_error> + +#include "libreichwein/file.h" + +#include "config.h" +#include "storage.h" +#include "whiteboard.h" + +namespace fs = std::filesystem; + +namespace { + const std::string testConfigFilename{"./test.conf"}; + const std::string testDbFilename{"./whiteboard.db3"}; +} + +class CompiledSQLTest: public ::testing::Test +{ +protected: + CompiledSQLTest(){ + } + + ~CompiledSQLTest() override{ + } + + void SetUp() override + { + File::setFile(testConfigFilename, R"CONFIG( +<config> + <datapath>.</datapath> + <maxage>2592000</maxage> +</config> +)CONFIG"); + std::error_code ec; + fs::remove(testDbFilename, ec); + + m_config = std::make_shared<Config>(testConfigFilename); + } + + void TearDown() override + { + std::error_code ec; + fs::remove(testDbFilename, ec); + fs::remove(testConfigFilename, ec); + } + + std::shared_ptr<Config> m_config; +}; + +TEST_F(CompiledSQLTest, connection) +{ +} + |