chore(test): fix a few minor memory leaks in test suite

This commit is contained in:
fallenoak 2025-11-16 07:27:22 -06:00
parent 768a535eea
commit 29d99a2cbc
2 changed files with 9 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -51,7 +51,9 @@ TEST_CASE("SThread::Create", "[thread]") {
SECTION("creates new thread") {
SThread thread;
auto threadName = const_cast<char*>("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);
}
}