#include "kapi/system.hpp" #include "kernel/test_support/cio.hpp" #include "kernel/test_support/cpu.hpp" #include #include SCENARIO("Kernel testing kapi::system shims", "[support]") { GIVEN("the test support infrastructure is initialized") { WHEN("a the system panics") { kernel::tests::cio::log_buffer().clear(); THEN("the correct exception is thrown") { REQUIRE_THROWS_AS(kapi::system::panic("[kernel:tests] Test Panic"), kernel::tests::cpu::halt); } THEN("the message is appended to the log buffer") { CHECK_THROWS(kapi::system::panic("[kernel:tests] Test Panic")); REQUIRE(kernel::tests::cio::log_buffer().flat_messages().contains("[kernel:tests] Test Panic")); } } } }