MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / ExpectExited

Method ExpectExited

Tests/PresentMon.cpp:453–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453void PresentMon::ExpectExited(char const* file, int line, DWORD timeoutMilliseconds, DWORD expectedExitCode)
454{
455 auto isRunning = IsRunning(timeoutMilliseconds);
456 if (isRunning) {
457 AddTestFailure(file, line, "PresentMon still running after %ums", timeoutMilliseconds);
458
459 TerminateProcess(hProcess, 0);
460 WaitForSingleObject(hProcess, INFINITE);
461 } else {
462 DWORD exitCode = 0;
463 GetExitCodeProcess(hProcess, &exitCode);
464
465 if (exitCode != expectedExitCode) {
466 AddTestFailure(file, line, "Unexpected PresentMon exit code: %d (expecting %d)", exitCode, expectedExitCode);
467 }
468 }
469
470 CloseHandle(hProcess);
471 CloseHandle(hThread);
472}

Callers

nothing calls this directly

Calls 1

AddTestFailureFunction · 0.85

Tested by

no test coverage detected