aboutsummaryrefslogtreecommitdiff
path: root/kernel/kapi/boot_modules.cpp
diff options
context:
space:
mode:
authorLukas Oesch <lukasoesch20@gmail.com>2026-04-09 08:32:51 +0200
committerLukas Oesch <lukasoesch20@gmail.com>2026-04-11 08:05:52 +0200
commit3c9ad45492d7417c65594fa7fa2fb9a8d5439276 (patch)
treec198818f2ba3f66d1dc7d8ce6ca783d43e4e70ca /kernel/kapi/boot_modules.cpp
parent9ce8ed3dd3aa5f6e21b53d02bac4f62eb8b3f337 (diff)
downloadteachos-3c9ad45492d7417c65594fa7fa2fb9a8d5439276.tar.xz
teachos-3c9ad45492d7417c65594fa7fa2fb9a8d5439276.zip
add deinit functions for singletons in tests
Diffstat (limited to 'kernel/kapi/boot_modules.cpp')
-rw-r--r--kernel/kapi/boot_modules.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/kernel/kapi/boot_modules.cpp b/kernel/kapi/boot_modules.cpp
index 5a0ef7f..0549368 100644
--- a/kernel/kapi/boot_modules.cpp
+++ b/kernel/kapi/boot_modules.cpp
@@ -4,14 +4,13 @@
#include <optional>
-namespace kapi::boot_modules
+namespace
{
+ constinit auto static registry = std::optional<kapi::boot_modules::boot_module_registry>{};
+} // namespace
- namespace
- {
- constinit auto static registry = std::optional<kapi::boot_modules::boot_module_registry>{};
- } // namespace
-
+namespace kapi::boot_modules
+{
auto set_boot_module_registry(boot_module_registry & new_registry) -> void
{
if (registry)
@@ -32,3 +31,11 @@ namespace kapi::boot_modules
return *registry;
}
} // namespace kapi::boot_modules
+
+namespace kernel::tests::boot_modules
+{
+ auto deinit() -> void
+ {
+ registry.reset();
+ }
+} // namespace kernel::tests::boot_modules