https://git.reactos.org/?p=reactos.git;a=commitdiff;h=50a72881be93938639d25…
commit 50a72881be93938639d25ca4d772594476667415
Author: Vitaly Orekhov <crce2000(a)mail.ru>
AuthorDate: Fri Sep 27 23:39:50 2024 +0300
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Oct 7 15:41:28 2024 +0200
[APITESTS] Add tests for CAtlList::AddHeadList and CAtlList::AddTailList
---
modules/rostests/apitests/atl/CAtlList.cpp | 45 ++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/modules/rostests/apitests/atl/CAtlList.cpp
b/modules/rostests/apitests/atl/CAtlList.cpp
index f9c2933beef..b0db7bba758 100644
--- a/modules/rostests/apitests/atl/CAtlList.cpp
+++ b/modules/rostests/apitests/atl/CAtlList.cpp
@@ -113,9 +113,54 @@ test_SwapElements()
ok_list(list, "3,1,2,");
}
+static void
+test_AppendListToTail()
+{
+ CAtlList<int> list;
+ list.AddTail(1);
+ list.AddTail(2);
+ list.AddTail(0);
+ ok_list(list, "1,2,0,");
+
+ CAtlList<int> list_tail;
+ list_tail.AddTail(8);
+ list_tail.AddTail(1);
+ list_tail.AddTail(0);
+ ok_list(list_tail, "8,1,0,");
+
+ list.AddTailList(&list_tail);
+ ok_list(list, "1,2,0,8,1,0,");
+
+ list_tail.AddTailList(&list);
+ ok_list(list_tail, "8,1,0,1,2,0,8,1,0,");
+}
+
+static void
+test_AppendListToHead()
+{
+ CAtlList<int> list_head;
+ list_head.AddHead(0);
+ list_head.AddHead(0);
+ list_head.AddHead(2);
+ ok_list(list_head, "2,0,0,");
+
+ CAtlList<int> list;
+ list.AddHead(8);
+ list.AddHead(9);
+ list.AddHead(7);
+ ok_list(list, "7,9,8,");
+
+ list.AddHeadList(&list_head);
+ ok_list(list, "2,0,0,7,9,8,");
+
+ list_head.AddHeadList(&list);
+ ok_list(list_head, "2,0,0,7,9,8,2,0,0,");
+}
START_TEST(CAtlList)
{
test_BasicCases();
test_SwapElements();
+ test_AppendListToTail();
+ test_AppendListToHead();
}