From 29d99a2cbc4f4c7edcc441cac98216c3f006eb27 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sun, 16 Nov 2025 07:27:22 -0600 Subject: [PATCH] chore(test): fix a few minor memory leaks in test suite --- test/List.cpp | 6 ++++++ test/Thread.cpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/List.cpp b/test/List.cpp index 1d1a793..829ee0a 100644 --- a/test/List.cpp +++ b/test/List.cpp @@ -27,6 +27,8 @@ TEST_CASE("TSList", "[list]") { // offset from the source list and initializes the list terminator. REQUIRE(list.Head() == node); REQUIRE(listCopy.Head() == nullptr); + + delete node; } } @@ -47,6 +49,8 @@ TEST_CASE("TSList::IsEmpty", "[list]") { STORM_LIST(TestListNode) list; list.NewNode(STORM_LIST_TAIL, 0, 0); CHECK_FALSE(list.IsEmpty()); + + list.Clear(); } SECTION("returns true after clearing a populated list") { @@ -172,5 +176,7 @@ TEST_CASE("TSExplicitList", "[list]") { // the source list and initializes the list terminator. REQUIRE(list.Head() == node); REQUIRE(listCopy.Head() == nullptr); + + delete node; } } diff --git a/test/Thread.cpp b/test/Thread.cpp index 4cd8c6d..0eafb88 100644 --- a/test/Thread.cpp +++ b/test/Thread.cpp @@ -51,7 +51,9 @@ TEST_CASE("SThread::Create", "[thread]") { SECTION("creates new thread") { SThread thread; auto threadName = const_cast("TestThread"); - auto threadParam = SMemAlloc(16, nullptr, 0, 0x0); + auto threadParam = STORM_ALLOC(16); REQUIRE(SThread::Create(threadProc, threadParam, thread, threadName, 0) != 0); + + STORM_FREE(threadParam); } }