mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-05 17:17:42 +00:00
Ports the agent lifecycle, duplicate agent-id, built-in-id clash and status-resolution tests. The loader runs on a detached worker thread, so the lifecycle tests live in their own executable. Tests install the production unload-side registry wiring themselves (no GUI in the test binary) and register agents manually so concurrent loads stay deterministic.
24 lines
947 B
C++
24 lines
947 B
C++
#include <catch2/catch_all.hpp>
|
|
|
|
#include <slic3r/GUI/PluginStatus.hpp>
|
|
|
|
using Slic3r::GUI::PluginStatus;
|
|
using Slic3r::GUI::resolve_plugin_status;
|
|
|
|
TEST_CASE("resolve_plugin_status precedence", "[plugin][status]") {
|
|
// the new branch: loaded module + error -> runtime fault, not a load failure.
|
|
REQUIRE(resolve_plugin_status(/*loading*/ false, /*has_error*/ true, /*is_loaded*/ true) == PluginStatus::RuntimeError);
|
|
|
|
// error without a live module is a load-time Error.
|
|
REQUIRE(resolve_plugin_status(false, true, false) == PluginStatus::Error);
|
|
|
|
// loading wins over a pending error so a reload never flashes red.
|
|
REQUIRE(resolve_plugin_status(true, true, true) == PluginStatus::Loading);
|
|
|
|
// healthy loaded plugin.
|
|
REQUIRE(resolve_plugin_status(false, false, true) == PluginStatus::Activated);
|
|
|
|
// nothing loaded, no error.
|
|
REQUIRE(resolve_plugin_status(false, false, false) == PluginStatus::Inactive);
|
|
}
|