summaryrefslogtreecommitdiffhomepage
path: root/tests/test-whiteboard.cpp
blob: 2c9d37bb5f1850a91ad19f152d47676457f4fcbd (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#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 fs::path webserverConfigFilename{"./webserver.conf"};
 const fs::path testConfigFilename{"./whiteboard.conf"};
 const fs::path testDbFilename{"./whiteboard.db3"};
}

class Webserver
{
public:
 Webserver()
 {
 }

 ~Webserver()
 {
  stop();
 }

 void runInBackground()
 {
 }

 void stop()
 {
 }
};

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)
{
}