diff options
Diffstat (limited to 'runtime/test/xgameruntime_test.cpp')
| -rw-r--r-- | runtime/test/xgameruntime_test.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/test/xgameruntime_test.cpp b/runtime/test/xgameruntime_test.cpp index c5a0e988e..062840c80 100644 --- a/runtime/test/xgameruntime_test.cpp +++ b/runtime/test/xgameruntime_test.cpp | |||
| @@ -279,6 +279,20 @@ void check_run_time_load() { | |||
| 279 | reinterpret_cast<SetSensitive>(slot(t, 27))(t, false) == S_OK && | 279 | reinterpret_cast<SetSensitive>(slot(t, 27))(t, false) == S_OK && |
| 280 | !reinterpret_cast<IsSensitive>(slot(t, 30))(t), | 280 | !reinterpret_cast<IsSensitive>(slot(t, 30))(t), |
| 281 | "slots 27 and 30 set and read this thread's time-sensitive flag"); | 281 | "slots 27 and 30 set and read this thread's time-sensitive flag"); |
| 282 | // Slot 8 (XAsyncBeginAlloc, private, signature not measured) must not report a begun call whose provider | ||
| 283 | // never received XAsyncOp::Begin: either it refuses, or the provider saw Begin exactly once. | ||
| 284 | static std::atomic<int> s_begins{0}; | ||
| 285 | XAsyncProvider* provider = [](XAsyncOp op, const XAsyncProviderData*) -> HRESULT { | ||
| 286 | if (op == XAsyncOp::Begin) s_begins.fetch_add(1); | ||
| 287 | return S_OK; | ||
| 288 | }; | ||
| 289 | XAsyncBlock alloc_block{}; | ||
| 290 | using BeginAlloc = HRESULT(STDMETHODCALLTYPE*)(void*, XAsyncBlock*, const void*, const char*, XAsyncProvider*, | ||
| 291 | size_t, size_t, void*); | ||
| 292 | const HRESULT alloc_hr = | ||
| 293 | reinterpret_cast<BeginAlloc>(slot(t, 8))(t, &alloc_block, nullptr, "test", provider, 16, 0, nullptr); | ||
| 294 | check(FAILED(alloc_hr) || s_begins.load() == 1, | ||
| 295 | "slot 8 (XAsyncBeginAlloc) never reports success for a call whose provider did not begin"); | ||
| 282 | void* unk = nullptr; | 296 | void* unk = nullptr; |
| 283 | const GUID iunknown = {0, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}}; | 297 | const GUID iunknown = {0, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}}; |
| 284 | using QI = HRESULT(STDMETHODCALLTYPE*)(void*, REFIID, void**); | 298 | using QI = HRESULT(STDMETHODCALLTYPE*)(void*, REFIID, void**); |