Fix module logic, updated tests, add tests (#584)
This commit is contained in:
committed by
GitHub
parent
2a2558b29a
commit
ca5b071859
@@ -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; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user