mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
chore(test): fix a few minor memory leaks in test suite
This commit is contained in:
parent
768a535eea
commit
29d99a2cbc
2 changed files with 9 additions and 1 deletions
|
|
@ -27,6 +27,8 @@ TEST_CASE("TSList", "[list]") {
|
||||||
// offset from the source list and initializes the list terminator.
|
// offset from the source list and initializes the list terminator.
|
||||||
REQUIRE(list.Head() == node);
|
REQUIRE(list.Head() == node);
|
||||||
REQUIRE(listCopy.Head() == nullptr);
|
REQUIRE(listCopy.Head() == nullptr);
|
||||||
|
|
||||||
|
delete node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,6 +49,8 @@ TEST_CASE("TSList::IsEmpty", "[list]") {
|
||||||
STORM_LIST(TestListNode) list;
|
STORM_LIST(TestListNode) list;
|
||||||
list.NewNode(STORM_LIST_TAIL, 0, 0);
|
list.NewNode(STORM_LIST_TAIL, 0, 0);
|
||||||
CHECK_FALSE(list.IsEmpty());
|
CHECK_FALSE(list.IsEmpty());
|
||||||
|
|
||||||
|
list.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("returns true after clearing a populated list") {
|
SECTION("returns true after clearing a populated list") {
|
||||||
|
|
@ -172,5 +176,7 @@ TEST_CASE("TSExplicitList", "[list]") {
|
||||||
// the source list and initializes the list terminator.
|
// the source list and initializes the list terminator.
|
||||||
REQUIRE(list.Head() == node);
|
REQUIRE(list.Head() == node);
|
||||||
REQUIRE(listCopy.Head() == nullptr);
|
REQUIRE(listCopy.Head() == nullptr);
|
||||||
|
|
||||||
|
delete node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ TEST_CASE("SThread::Create", "[thread]") {
|
||||||
SECTION("creates new thread") {
|
SECTION("creates new thread") {
|
||||||
SThread thread;
|
SThread thread;
|
||||||
auto threadName = const_cast<char*>("TestThread");
|
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);
|
REQUIRE(SThread::Create(threadProc, threadParam, thread, threadName, 0) != 0);
|
||||||
|
|
||||||
|
STORM_FREE(threadParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue