From 2b9806dc125e86e681f8d7cd319c4168ea2a3e4c Mon Sep 17 00:00:00 2001 From: Krzysztof Bogacki Date: Wed, 12 Jun 2024 01:25:42 +0200 Subject: [PATCH] tests: Fix ID3D12CommandQueue::GetDevice mock not incrementing ref count And check ref counts at the end of D3D12 Reflex tests. --- tests/nvapi_d3d12.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/nvapi_d3d12.cpp b/tests/nvapi_d3d12.cpp index 889bd038..94fa57d9 100644 --- a/tests/nvapi_d3d12.cpp +++ b/tests/nvapi_d3d12.cpp @@ -82,6 +82,7 @@ TEST_CASE("D3D12 methods succeed", "[.d3d12]") { .RETURN(commandQueueRefCount); ALLOW_CALL(commandQueue, GetDevice(__uuidof(ID3D12Device), _)) .LR_SIDE_EFFECT(*_2 = static_cast(&device)) + .LR_SIDE_EFFECT(deviceRefCount++) .RETURN(S_OK); SECTION("CreateGraphicsPipelineState for other than SetDepthBounds returns not-supported") { @@ -912,5 +913,9 @@ TEST_CASE("D3D12 methods succeed", "[.d3d12]") { REQUIRE(NvAPI_D3D12_SetAsyncFrameMarker(nullptr, ¶ms) == NVAPI_INVALID_POINTER); } } + + REQUIRE(deviceRefCount == 0); + REQUIRE(commandListRefCount == 0); + REQUIRE(lowLatencyDeviceRefCount == 0); } }