summaryrefslogtreecommitdiffhomepage
path: root/tests/test-compiledsql.cpp
blob: 4fe29e0ffdebb252323e8c1f16b5075856d89c39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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)
{
}