Skip to content

Commit

Permalink
tests: Fix ID3D12CommandQueue::GetDevice mock not incrementing ref count
Browse files Browse the repository at this point in the history
And check ref counts at the end of D3D12 Reflex tests.
  • Loading branch information
Saancreed authored and jp7677 committed Jun 15, 2024
1 parent e93e847 commit 2b9806d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/nvapi_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ TEST_CASE("D3D12 methods succeed", "[.d3d12]") {
.RETURN(commandQueueRefCount);
ALLOW_CALL(commandQueue, GetDevice(__uuidof(ID3D12Device), _))
.LR_SIDE_EFFECT(*_2 = static_cast<ID3D12Device*>(&device))
.LR_SIDE_EFFECT(deviceRefCount++)
.RETURN(S_OK);

SECTION("CreateGraphicsPipelineState for other than SetDepthBounds returns not-supported") {
Expand Down Expand Up @@ -912,5 +913,9 @@ TEST_CASE("D3D12 methods succeed", "[.d3d12]") {
REQUIRE(NvAPI_D3D12_SetAsyncFrameMarker(nullptr, &params) == NVAPI_INVALID_POINTER);
}
}

REQUIRE(deviceRefCount == 0);
REQUIRE(commandListRefCount == 0);
REQUIRE(lowLatencyDeviceRefCount == 0);
}
}

0 comments on commit 2b9806d

Please sign in to comment.