Separate settings tests

Signed-off-by: Lucca Jiménez Könings <development@jimkoen.com>
This commit is contained in:
Lucca Jiménez Könings 2024-05-21 14:24:44 +02:00
parent 84f5f95e54
commit d30dccc94a
No known key found for this signature in database

View File

@ -173,7 +173,7 @@ struct Settings {
void setConsoleInputAccessMapping(const ComposedKey& keyName, bool value);
};
TEST_CASE("settings variant functions") {
TEST_CASE("settings get/set") {
Settings settings;
settings.set(Settings::General_Name, "hello, world");
CHECK_EQ(settings.getAsString(Settings::General_Name), "hello, world");
@ -181,7 +181,10 @@ TEST_CASE("settings variant functions") {
CHECK_EQ(settings.getAsString(Settings::General_Name), "hello, world");
settings.set(Settings::General_MaxPlayers, 12);
CHECK_EQ(settings.getAsInt(Settings::General_MaxPlayers), 12);
}
TEST_CASE("settings check for exception on wrong input type"){
Settings settings;
CHECK_THROWS(settings.set(Settings::General_Debug, "hello, world"));
CHECK_NOTHROW(settings.set(Settings::General_Debug, false));
}