fix: preset resolution

This commit is contained in:
Ian Chua
2026-07-14 19:48:39 +08:00
parent 3daa4336e3
commit 71d0380467
8 changed files with 268 additions and 355 deletions

View File

@@ -72,18 +72,3 @@ TEST_CASE("referenced_capabilities skips malformed manifest entries", "[PluginRe
CHECK(capability_names(referenced_capabilities(Preset::TYPE_PRINT, preset)) == std::vector<std::string>{"CapA"});
}
TEST_CASE("preset_type_for_capability names the preset type whose options reference the capability", "[PluginResolver]")
{
// Read out of the ConfigDef: declaring a plugin_type on an option is what puts its capability
// type on this map.
CHECK(preset_type_for_capability(PluginCapabilityType::SlicingPipeline) == Preset::TYPE_PRINT);
CHECK(preset_type_for_capability(PluginCapabilityType::PrinterConnection) == Preset::TYPE_PRINTER);
}
TEST_CASE("preset_type_for_capability leaves capability types no option accepts unowned", "[PluginResolver]")
{
// No option accepts them, so no preset can override them: they read config.json alone.
CHECK(preset_type_for_capability(PluginCapabilityType::Automation) == Preset::TYPE_INVALID);
CHECK(preset_type_for_capability(PluginCapabilityType::Unknown) == Preset::TYPE_INVALID);
}