ReactOS  0.4.15-dev-1177-g6cb3b62
ExXList.h
Go to the documentation of this file.
1 /* used by ExSingleList and ExSequencedList tests */
2 static
3 VOID
5  IN PXLIST_HEADER ListHead,
7  IN PKSPIN_LOCK pSpinLock)
8 {
9  USHORT ExpectedSequence = 0;
10  PXLIST_ENTRY Ret;
11 
12  Ret = FlushXList(ListHead);
13  ok_eq_pointer(Ret, NULL);
14  CheckXListHeader(ListHead, NULL, 0);
15 
16  Ret = PopXList(ListHead, pSpinLock);
17  ok_eq_pointer(Ret, NULL);
18  CheckXListHeader(ListHead, NULL, 0);
19 
20  Ret = PushXList(ListHead, &Entries[0], pSpinLock);
21  ++ExpectedSequence;
22  ok_eq_pointer(Ret, NULL);
24  CheckXListHeader(ListHead, &Entries[0], 1);
25 
26  Ret = PushXList(ListHead, &Entries[1], pSpinLock);
27  ++ExpectedSequence;
28  ok_eq_pointer(Ret, &Entries[0]);
31  CheckXListHeader(ListHead, &Entries[1], 2);
32 
33  Ret = PopXList(ListHead, pSpinLock);
34  ok_eq_pointer(Ret, &Entries[1]);
37  CheckXListHeader(ListHead, &Entries[0], 1);
38 
39  Ret = PopXList(ListHead, pSpinLock);
40  ok_eq_pointer(Ret, &Entries[0]);
43  CheckXListHeader(ListHead, NULL, 0);
44 
45  Ret = PopXList(ListHead, pSpinLock);
46  ok_eq_pointer(Ret, NULL);
49  CheckXListHeader(ListHead, NULL, 0);
50 
51  /* add entries again */
52  Ret = PushXList(ListHead, &Entries[0], pSpinLock);
53  ++ExpectedSequence;
54  ok_eq_pointer(Ret, NULL);
56  CheckXListHeader(ListHead, &Entries[0], 1);
57 
58  Ret = PushXList(ListHead, &Entries[1], pSpinLock);
59  ++ExpectedSequence;
60  ok_eq_pointer(Ret, &Entries[0]);
63  CheckXListHeader(ListHead, &Entries[1], 2);
64 
65  Ret = PopXList(ListHead, pSpinLock);
66  ok_eq_pointer(Ret, &Entries[1]);
69  CheckXListHeader(ListHead, &Entries[0], 1);
70 
71  Ret = PushXList(ListHead, &Entries[1], pSpinLock);
72  ++ExpectedSequence;
73  ok_eq_pointer(Ret, &Entries[0]);
76  CheckXListHeader(ListHead, &Entries[1], 2);
77 
78  Ret = PushXList(ListHead, &Entries[2], pSpinLock);
79  ++ExpectedSequence;
80  ok_eq_pointer(Ret, &Entries[1]);
84  CheckXListHeader(ListHead, &Entries[2], 3);
85 
86  Ret = FlushXList(ListHead);
87  ok_eq_pointer(Ret, &Entries[2]);
88  CheckXListHeader(ListHead, NULL, 0);
89 }
90 
91 #undef TestXListFunctional
#define IN
Definition: typedefs.h:39
#define PXLIST_ENTRY
#define PopXList
#define ok_eq_pointer(value, expected)
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
#define PushXList
smooth NULL
Definition: ftsmooth.c:416
#define ok_free_xlist
#define CheckXListHeader
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:630
#define FlushXList
static VOID TestXListFunctional(IN PXLIST_HEADER ListHead, IN PXLIST_ENTRY Entries, IN PKSPIN_LOCK pSpinLock)
Definition: ExXList.h:4
LIST_ENTRY Entries[5]
Definition: ExDoubleList.c:8
unsigned short USHORT
Definition: pedump.c:61
#define PXLIST_HEADER