From ac993e1cf8ec4c55cbd1e80c7b94ac492d6dc4e8 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 6 Mar 2026 06:36:01 +0100 Subject: [FEAT] HeapMgr: Add LockDelegate to allocation calls, and re-introduce double-free prevention. [CHORE] FileMgr: Cleanup and tweaks. [CHORE] ABI: Update copyright year. Signed-off-by: Amlal El Mahrouss --- test/kernel_test/error.test.cc | 67 ------------------------------------------ 1 file changed, 67 deletions(-) delete mode 100644 test/kernel_test/error.test.cc (limited to 'test/kernel_test/error.test.cc') diff --git a/test/kernel_test/error.test.cc b/test/kernel_test/error.test.cc deleted file mode 100644 index ece8f71d..00000000 --- a/test/kernel_test/error.test.cc +++ /dev/null @@ -1,67 +0,0 @@ -/// \file error.test.cc -/// \brief Error handling API tests. -/// \author Amlal El Mahrouss (amlal at nekernel dot org) - -#include -#include - -/// \note ErrGetLastError tests -KT_DECL_TEST(ErrGetLastErrorInitial, []() -> bool { - SInt32 error = ErrGetLastError(); - return error >= 0; -}); - -KT_DECL_TEST(ErrGetLastErrorAfterSuccess, []() -> bool { - auto heap = MmCreateHeap(1024, 0); - if (!heap) return NO; - - SInt32 error = ErrGetLastError(); - MmDestroyHeap(heap); - - return error == 0; -}); - -KT_DECL_TEST(ErrGetLastErrorAfterFailure, []() -> bool { - auto heap = MmCreateHeap(0, 0); - - SInt32 error = ErrGetLastError(); - - return error != 0; -}); - -KT_DECL_TEST(ErrGetLastErrorAfterInvalidFile, []() -> bool { - auto file = IoOpenFile("/invalid/path/that/does/not/exist", nullptr); - - SInt32 error = ErrGetLastError(); - - if (file) IoCloseFile(file); - - return error != 0; -}); - -KT_DECL_TEST(ErrGetLastErrorAfterNullOp, []() -> bool { - auto ptr = MmCopyMemory(nullptr, nullptr, 10); - - SInt32 error = ErrGetLastError(); - - return error != 0; -}); - -KT_DECL_TEST(ErrGetLastErrorMultipleCalls, []() -> bool { - SInt32 error1 = ErrGetLastError(); - SInt32 error2 = ErrGetLastError(); - - return error1 == error2; -}); - -/// \brief Run error tests. -IMPORT_C SInt32 KT_TEST_MAIN() { - KT_RUN_TEST(ErrGetLastErrorInitial); - KT_RUN_TEST(ErrGetLastErrorAfterSuccess); - KT_RUN_TEST(ErrGetLastErrorAfterFailure); - KT_RUN_TEST(ErrGetLastErrorAfterInvalidFile); - KT_RUN_TEST(ErrGetLastErrorAfterNullOp); - KT_RUN_TEST(ErrGetLastErrorMultipleCalls); - - return KT_TEST_SUCCESS; -} -- cgit v1.2.3