mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-25 13:30:43 +00:00
Separate settings tests
Signed-off-by: Lucca Jiménez Könings <development@jimkoen.com>
This commit is contained in:
1 file changed
+4
-1
+4
-1
@@ -173,7 +173,7 @@ struct Settings {
|
|||||||
void setConsoleInputAccessMapping(const ComposedKey& keyName, bool value);
|
void setConsoleInputAccessMapping(const ComposedKey& keyName, bool value);
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_CASE("settings variant functions") {
|
TEST_CASE("settings get/set") {
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.set(Settings::General_Name, "hello, world");
|
settings.set(Settings::General_Name, "hello, world");
|
||||||
CHECK_EQ(settings.getAsString(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");
|
CHECK_EQ(settings.getAsString(Settings::General_Name), "hello, world");
|
||||||
settings.set(Settings::General_MaxPlayers, 12);
|
settings.set(Settings::General_MaxPlayers, 12);
|
||||||
CHECK_EQ(settings.getAsInt(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_THROWS(settings.set(Settings::General_Debug, "hello, world"));
|
||||||
CHECK_NOTHROW(settings.set(Settings::General_Debug, false));
|
CHECK_NOTHROW(settings.set(Settings::General_Debug, false));
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user