mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
Add category headers. Alphabetical sorting when no search query. Recent count adjustments
This commit is contained in:
@@ -43,3 +43,41 @@ TEST_CASE("AppConfig network version helpers", "[AppConfig]") {
|
||||
REQUIRE(config.is_network_version_skipped("02.01.01.52"));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("AppConfig Speed Dial recent count defaults, clamps and parses", "[AppConfig]") {
|
||||
AppConfig config;
|
||||
|
||||
SECTION("unset falls back to the default") {
|
||||
REQUIRE(config.get_speed_dial_recent_count() == SPEED_DIAL_RECENT_COUNT_DEFAULT);
|
||||
}
|
||||
|
||||
SECTION("zero disables recents") {
|
||||
config.set(SETTING_SPEED_DIAL_RECENT_COUNT, "0");
|
||||
REQUIRE(config.get_speed_dial_recent_count() == 0);
|
||||
}
|
||||
|
||||
SECTION("a value in range is returned as-is") {
|
||||
config.set(SETTING_SPEED_DIAL_RECENT_COUNT, "7");
|
||||
REQUIRE(config.get_speed_dial_recent_count() == 7);
|
||||
}
|
||||
|
||||
SECTION("the maximum is kept") {
|
||||
config.set(SETTING_SPEED_DIAL_RECENT_COUNT, "10");
|
||||
REQUIRE(config.get_speed_dial_recent_count() == SPEED_DIAL_RECENT_COUNT_MAX);
|
||||
}
|
||||
|
||||
SECTION("values above the maximum clamp down") {
|
||||
config.set(SETTING_SPEED_DIAL_RECENT_COUNT, "42");
|
||||
REQUIRE(config.get_speed_dial_recent_count() == SPEED_DIAL_RECENT_COUNT_MAX);
|
||||
}
|
||||
|
||||
SECTION("negative values clamp up to 0") {
|
||||
config.set(SETTING_SPEED_DIAL_RECENT_COUNT, "-3");
|
||||
REQUIRE(config.get_speed_dial_recent_count() == 0);
|
||||
}
|
||||
|
||||
SECTION("garbage falls back to the default") {
|
||||
config.set(SETTING_SPEED_DIAL_RECENT_COUNT, "abc");
|
||||
REQUIRE(config.get_speed_dial_recent_count() == SPEED_DIAL_RECENT_COUNT_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user