summaryrefslogtreecommitdiffhomepage
path: root/tests/test-whiteboard.cpp
blob: 6fe476d16d77c600b1f988af42b765d1c00e18c6 (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 WhiteboardTest: public ::testing::Test
{
protected:
 WhiteboardTest(){
 }

 ~WhiteboardTest() 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(WhiteboardTest, connection)
{
}