mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
feat(list): add TSList::IsEmpty
This commit is contained in:
parent
d590e2e94f
commit
b52736a360
2 changed files with 26 additions and 0 deletions
|
|
@ -19,6 +19,26 @@ TEST_CASE("TSList::Head", "[list]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("TSList::IsEmpty", "[list]") {
|
||||
SECTION("returns true if just initialized") {
|
||||
STORM_LIST(TestListNode) list;
|
||||
CHECK(list.IsEmpty());
|
||||
}
|
||||
|
||||
SECTION("returns false if there are linked items") {
|
||||
STORM_LIST(TestListNode) list;
|
||||
list.NewNode(STORM_LIST_TAIL, 0, 0);
|
||||
CHECK_FALSE(list.IsEmpty());
|
||||
}
|
||||
|
||||
SECTION("returns true after clearing a populated list") {
|
||||
STORM_LIST(TestListNode) list;
|
||||
list.NewNode(STORM_LIST_TAIL, 0, 0);
|
||||
list.Clear();
|
||||
CHECK(list.IsEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("TSList::LinkToHead", "[list]") {
|
||||
SECTION("links node to head correctly") {
|
||||
STORM_LIST(TestListNode) list;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue