aboutsummaryrefslogtreecommitdiff
path: root/test/conf
diff options
context:
space:
mode:
Diffstat (limited to 'test/conf')
-rw-r--r--test/conf/main.cpp54
-rw-r--r--test/conf/meson.build6
-rw-r--r--test/conf/smolbote.cfg5
3 files changed, 0 insertions, 65 deletions
diff --git a/test/conf/main.cpp b/test/conf/main.cpp
deleted file mode 100644
index e499a4d..0000000
--- a/test/conf/main.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <fstream>
-#include <iostream>
-#include <string>
-#include "configuration.h"
-#include <cassert>
-
-int main(int, char**)
-{
- std::fstream fs;
- fs.open("smolbote.cfg", std::fstream::in);
- assert(fs.is_open());
-
- {
- auto value_map = std::make_unique<Configuration, std::initializer_list<std::pair<std::string, conf_value_t>>>({
- { "test", std::string("unknown") },
- { "integer-1", 20 },
- { "integer-2", 30 }
- });
- value_map->read(fs);
-
- Configuration::move_global(std::move(value_map));
- fs.close();
- }
-
- {
- Configuration g;
- assert(g.value<std::string>("test") == "value");
- assert(g.value<std::string>("plugins.path") == "/usr/local/lib/smolbote/plugins");
- assert(g.value<int>("integer-1") == 20);
- assert(g.value<int>("integer-2") == 22);
- }
-
-/*
- {
- const Configuration conf(std::move(value_map));
-
- assert(conf.value<std::string>("test") == "value");
- assert(conf.value<std::string>("plugins.path") == "/usr/local/lib/smolbote/plugins");
- assert(conf.value<int>("integer-1") == 20);
- assert(conf.value<int>("integer-2") == 22);
- }
-*/
- // Configuration is now destroyed
-
-
- // This should be a compiler warning
- //const Configuration c(std::move(value_map));
- //assert(c.value<std::string>("test") == "value");
-
- // This should be a compiler warning and runtime error
- //assert(value_map.value<std::string>("test").value() == "value");
-
- return 0;
-}
diff --git a/test/conf/meson.build b/test/conf/meson.build
deleted file mode 100644
index de67db7..0000000
--- a/test/conf/meson.build
+++ /dev/null
@@ -1,6 +0,0 @@
-e = executable('conf_test',
- dependencies: [dep_qt5, dep_configuration],
- sources: 'main.cpp'
-)
-
-test('conf_test', e, workdir : meson.source_root()/'test/conf')
diff --git a/test/conf/smolbote.cfg b/test/conf/smolbote.cfg
deleted file mode 100644
index 25467ef..0000000
--- a/test/conf/smolbote.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-# this is a comment
-test = value
-plugins.path = /usr/local/lib/smolbote/plugins
-
-integer-2 = 22