tangled
alpha
login
or
join now
huwcampbell.com
/
reactos
0
fork
atom
Reactos
0
fork
atom
overview
issues
pulls
pipelines
[KERNEL32_APITEST] Improve InitOnce test
Timo Kreuzer
2 years ago
7497f028
6286475d
+11
1 changed file
expand all
collapse all
unified
split
modules
rostests
apitests
kernel32
InitOnce.c
+11
modules/rostests/apitests/kernel32/InitOnce.c
reviewed
···
154
154
155
155
/* Re-initialize One-Time initialization structure by using INIT_ONCE_STATIC_INIT */
156
156
InitOnce = (INIT_ONCE)INIT_ONCE_STATIC_INIT;
157
157
+
ulContextData = 0xdeadbeef;
157
158
158
159
/* Perform synchronous initialization by using InitOnceBeginInitialize */
159
160
fPending = FALSE;
···
168
169
{
169
170
goto _test_async;
170
171
}
172
172
+
173
173
+
/* Call again to check whether initialization has completed */
174
174
+
fPending = 0xdeadbeef;
175
175
+
bRet = pfnInitOnceBeginInitialize(&InitOnce,
176
176
+
INIT_ONCE_CHECK_ONLY,
177
177
+
&fPending,
178
178
+
(LPVOID*)&ulContextData);
179
179
+
ok(bRet == FALSE, "InitOnceBeginInitialize should fail\n");
180
180
+
ok(fPending == 0xdeadbeef, "fPending should be unmodified\n");
181
181
+
ok(ulContextData == 0xdeadbeef, "ulContextData should be unmodified\n");
171
182
172
183
/* Complete the initialization */
173
184
InitWorker(&ulInitCount, &ulTempContext);