ReactOS
0.4.15-dev-8636-g945e856
ExXList.h
Go to the documentation of this file.
1
/* used by ExSingleList and ExSequencedList tests */
2
static
3
VOID
4
TestXListFunctional
(
5
IN
PXLIST_HEADER
ListHead,
6
IN
PXLIST_ENTRY
Entries
,
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
);
23
ok_eq_pointer
(
Entries
[0].Next,
NULL
);
24
CheckXListHeader
(ListHead, &
Entries
[0], 1);
25
26
Ret =
PushXList
(ListHead, &
Entries
[1], pSpinLock);
27
++ExpectedSequence;
28
ok_eq_pointer
(Ret, &
Entries
[0]);
29
ok_eq_pointer
(
Entries
[0].Next,
NULL
);
30
ok_eq_pointer
(
Entries
[1].Next, &
Entries
[0]);
31
CheckXListHeader
(ListHead, &
Entries
[1], 2);
32
33
Ret =
PopXList
(ListHead, pSpinLock);
34
ok_eq_pointer
(Ret, &
Entries
[1]);
35
ok_eq_pointer
(
Entries
[0].Next,
NULL
);
36
ok_free_xlist
(
Entries
[1].Next, &
Entries
[0]);
37
CheckXListHeader
(ListHead, &
Entries
[0], 1);
38
39
Ret =
PopXList
(ListHead, pSpinLock);
40
ok_eq_pointer
(Ret, &
Entries
[0]);
41
ok_free_xlist
(
Entries
[0].Next,
NULL
);
42
ok_free_xlist
(
Entries
[1].Next, &
Entries
[0]);
43
CheckXListHeader
(ListHead,
NULL
, 0);
44
45
Ret =
PopXList
(ListHead, pSpinLock);
46
ok_eq_pointer
(Ret,
NULL
);
47
ok_free_xlist
(
Entries
[0].Next,
NULL
);
48
ok_free_xlist
(
Entries
[1].Next, &
Entries
[0]);
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
);
55
ok_eq_pointer
(
Entries
[0].Next,
NULL
);
56
CheckXListHeader
(ListHead, &
Entries
[0], 1);
57
58
Ret =
PushXList
(ListHead, &
Entries
[1], pSpinLock);
59
++ExpectedSequence;
60
ok_eq_pointer
(Ret, &
Entries
[0]);
61
ok_eq_pointer
(
Entries
[0].Next,
NULL
);
62
ok_eq_pointer
(
Entries
[1].Next, &
Entries
[0]);
63
CheckXListHeader
(ListHead, &
Entries
[1], 2);
64
65
Ret =
PopXList
(ListHead, pSpinLock);
66
ok_eq_pointer
(Ret, &
Entries
[1]);
67
ok_eq_pointer
(
Entries
[0].Next,
NULL
);
68
ok_free_xlist
(
Entries
[1].Next, &
Entries
[0]);
69
CheckXListHeader
(ListHead, &
Entries
[0], 1);
70
71
Ret =
PushXList
(ListHead, &
Entries
[1], pSpinLock);
72
++ExpectedSequence;
73
ok_eq_pointer
(Ret, &
Entries
[0]);
74
ok_eq_pointer
(
Entries
[0].Next,
NULL
);
75
ok_eq_pointer
(
Entries
[1].Next, &
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]);
81
ok_eq_pointer
(
Entries
[0].Next,
NULL
);
82
ok_eq_pointer
(
Entries
[1].Next, &
Entries
[0]);
83
ok_eq_pointer
(
Entries
[2].Next, &
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
TestXListFunctional
#define TestXListFunctional
Definition:
ExSequencedList.c:40
PushXList
#define PushXList
Definition:
ExSequencedList.c:30
ok_free_xlist
#define ok_free_xlist
Definition:
ExSequencedList.c:33
PXLIST_HEADER
#define PXLIST_HEADER
Definition:
ExSequencedList.c:28
PXLIST_ENTRY
#define PXLIST_ENTRY
Definition:
ExSequencedList.c:29
CheckXListHeader
#define CheckXListHeader
Definition:
ExSequencedList.c:34
FlushXList
#define FlushXList
Definition:
ExSequencedList.c:32
PopXList
#define PopXList
Definition:
ExSequencedList.c:31
Entries
static const ENTRY Entries[]
Definition:
MultiByteToWideChar.c:42
ok_eq_pointer
#define ok_eq_pointer(value, expected)
Definition:
apitest.h:59
NULL
#define NULL
Definition:
types.h:112
PKSPIN_LOCK
KSPIN_LOCK * PKSPIN_LOCK
Definition:
env_spec_w32.h:73
void
Definition:
nsiface.idl:2307
USHORT
unsigned short USHORT
Definition:
pedump.c:61
IN
#define IN
Definition:
typedefs.h:39
modules
rostests
kmtests
ntos_ex
ExXList.h
Generated on Tue Sep 10 2024 06:08:15 for ReactOS by
1.9.6