Clean the Config module, use static things instead of a stupid singleton

This commit is contained in:
louiz’
2016-06-14 03:02:36 +02:00
parent 550ab46f02
commit 46ff73662c
5 changed files with 52 additions and 86 deletions
+5 -5
View File
@@ -4,18 +4,18 @@
TEST_CASE("Config basic")
{
Config::filename = "test.cfg";
Config::file_must_exist = false;
// Write a value in the config file
Config::read_conf("test.cfg");
Config::set("coucou", "bonjour", true);
Config::close();
Config::clear();
bool error = false;
try
{
Config::file_must_exist = true;
CHECK(Config::read_conf());
CHECK(Config::get("coucou", "") == "bonjour");
CHECK(Config::get("does not exist", "default") == "default");
Config::close();
Config::clear();
}
catch (const std::ios::failure& e)
{