#include "framework/config_framework.hpp" #include #include struct IntegerTag : Config::Option { static constexpr const char* name = "IntegerTag"; using type = int; static type default_value() { return -1; } }; struct BooleanOptionTagTrue : Config::BooleanOption { static constexpr const char* name = "BooleanTagTrue"; }; struct BooleanOptionTagFalse : Config::BooleanOption { static constexpr const char* name = "BooleanTagFalse"; }; template<> bool Config::BooleanOption::default_val = true; template<> bool Config::BooleanOption::default_val = false; struct StructTag : Config::Option { struct Data { std::string string; bool operator == (const Data& d) const { return string == d.string; } }; static constexpr const char* name = "StructTag"; using type = Data; static type default_value() { return {"Hello World"}; } }; using Settings = Config::Options; TEST_CASE("Default Settings") { Settings settings; REQUIRE(settings.get() == -1); REQUIRE(settings.get() == true); REQUIRE(settings.get() == false); REQUIRE(settings.get() == StructTag::Data { "Hello World" }); }