Fix module logic, updated tests, add tests (#584)

This commit is contained in:
Ken Van Hoeylandt
2026-07-25 18:05:19 +02:00
committed by GitHub
parent 2a2558b29a
commit ca5b071859
4 changed files with 224 additions and 2 deletions
+6
View File
@@ -146,6 +146,9 @@ error_t module_ensure_started(Module* module) {
if (result != ERROR_NONE) { return result; }
}
error_t add_result = module_add(module);
if (add_result != ERROR_NONE && add_result != ERROR_INVALID_STATE) { return add_result; }
if (!module->internal->started) {
error_t result = module_start(module);
if (result != ERROR_NONE) { return result; }
@@ -162,6 +165,9 @@ error_t module_ensure_destructed(Module* module) {
if (result != ERROR_NONE) { return result; }
}
result = module_remove(module);
if (result != ERROR_NONE) { return result; }
result = module_destruct(module);
if (result != ERROR_NONE) { return result; }
}