Update
CI / GCC 16 / C++26 / default (pull_request) Has been cancelled
CI / GCC 16 / C++26 / sanitizers (pull_request) Has been cancelled
CI / GCC 16 / C++26 / werror (pull_request) Has been cancelled

Signed-off-by: faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-07-12 02:37:49 +03:00
1 parent 9a54f15e7e
commit f94366104e
7 files changed
+100 -13

No files matched your search

+25
View File
@@ -67,4 +67,29 @@ Void::Testing::Test configure_skipped_without_provider()
Void::Testing::expect_eq(configurable(h)->configure_calls(), 0);
}
Void::Testing::Test activation_failure_keeps_current_instance()
{
Void::FileSystem::TempDir tmp{"void_cfg_ready"};
const auto so = tmp.path() / "plugin.so";
std::filesystem::copy_file(VOID_CONFIGURABLE_PATH, so);
std::string payload{"accepted"};
PluginManager mgr{{.config_provider = [&payload](std::string_view) {
return payload;
}}};
Void::Testing::expect(mgr.load(so).has_value());
auto before = mgr.acquire("ConfigurablePlugin");
Void::Testing::expect_eq(configurable(before)->last_config(),
std::string_view{"accepted"});
payload = "reject";
const auto result = mgr.reload("ConfigurablePlugin");
Void::Testing::expect(!result.has_value());
Void::Testing::expect(result.error() == LoadError::ActivationFailed);
auto after = mgr.acquire("ConfigurablePlugin");
Void::Testing::expect(after.get() == before.get());
Void::Testing::expect_eq(configurable(after)->last_config(),
std::string_view{"accepted"});
}
#endif // configurable plugin available