Reactos

[KERNEL32_APITEST] Improve InitOnce test

+11
+11
modules/rostests/apitests/kernel32/InitOnce.c
··· 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 + 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 + 173 + /* Call again to check whether initialization has completed */ 174 + fPending = 0xdeadbeef; 175 + bRet = pfnInitOnceBeginInitialize(&InitOnce, 176 + INIT_ONCE_CHECK_ONLY, 177 + &fPending, 178 + (LPVOID*)&ulContextData); 179 + ok(bRet == FALSE, "InitOnceBeginInitialize should fail\n"); 180 + ok(fPending == 0xdeadbeef, "fPending should be unmodified\n"); 181 + ok(ulContextData == 0xdeadbeef, "ulContextData should be unmodified\n"); 171 182 172 183 /* Complete the initialization */ 173 184 InitWorker(&ulInitCount, &ulTempContext);