1f5e4c7d789306f79f725e720133d6bf60e9a84b
2 * PROJECT: ReactOS api tests
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Test for CAtlList
5 * COPYRIGHT: Copyright 2016-2019 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6 * Copyright 2019 Mark Jansen (mark.jansen@reactos.org)
23 ok(list1
.GetCount() == 0, "Expected list1's size is zero, was %d\n", list1
.GetCount());
25 ok(list1
.GetCount() == 1, "Expected list1's size is 1, was %d\n", list1
.GetCount());
26 POSITION head
= list1
.AddHead(12);
27 ok(list1
.GetCount() == 2, "Expected list1's size is 2, was %d\n", list1
.GetCount());
28 POSITION tail
= list1
.AddTail(90);
29 ok(list1
.GetCount() == 3, "Expected list1's size is 3, was %d\n", list1
.GetCount());
31 list1
.InsertBefore(head
, -123);
32 list1
.InsertAfter(head
, 34); // no longer head, but the POSITION should still be valid..
34 list1
.InsertBefore(tail
, 78);
35 list1
.InsertAfter(tail
, -44);
37 int expected
[] = {-123, 12, 34, 56, 78, 90, -44 };
38 int expected_size
= sizeof(expected
) / sizeof(expected
[0]);
40 POSITION it
= list1
.GetHeadPosition();
43 ok(index
< expected_size
, "Too many items, expected %d, got %d!\n", expected_size
, (index
+1));
44 int value
= list1
.GetNext(it
);
45 if (index
< expected_size
)
47 ok(value
== expected
[index
], "Wrong value, got %d, expected %d\n", value
, expected
[index
]);
51 ok(0, "Extra value: %d\n", value
);
55 ok(it
== NULL
, "it does still point to something!\n");