From d30dccc94ae9922b75fb80c758881a465f5a07ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucca=20Jim=C3=A9nez=20K=C3=B6nings?= Date: Tue, 21 May 2024 14:24:44 +0200 Subject: [PATCH] Separate settings tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lucca Jiménez Könings --- include/Settings.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/Settings.h b/include/Settings.h index 2f9565c..071088c 100644 --- a/include/Settings.h +++ b/include/Settings.h @@ -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)); }