mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-04 22:31:02 +00:00
Covers src/slic3r/Utils, src/slic3r/plugin, src/slic3r/Config, src/libvgcode, src/dev-utils, src/OrcaSlicer.cpp and tests/, the directories left after src/slic3r/GUI and src/libslic3r. Generated with clang-tidy misc-include-cleaner. libvgcode's own headers are included by relative path as in the rest of that library, and Catch2 and pybind11 with angle brackets as elsewhere in the repo.
25 lines
987 B
C++
25 lines
987 B
C++
#include <catch2/catch_test_macros.hpp>
|
|
#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);
|
|
}
|