refactor: improve test infrastructure and fix OpenGL GLAD initialization
- Rename D3D12Enum.h to D3D12Enums.h for naming consistency - Fix OpenGL unit test GLAD initialization by using gladLoadGL() instead of gladLoadGLLoader(wglGetProcAddress) for fallback support - Migrate remaining tests to use gtest_discover_tests for granular test discovery (math, core, containers, memory, threading, debug, components, scene, resources, input, opengl) - Remove obsolete TEST_RESOURCES_DIR and copy_directory commands from OpenGL unit test CMakeLists (minimal/Res doesn't exist) - Update TEST_SPEC.md with performance metrics and per-module build/test commands for faster development workflow - Update CMake path references to use lowercase paths
This commit is contained in:
@@ -1,23 +1,18 @@
|
||||
#include "fixtures/D3D12TestFixture.h"
|
||||
#include "XCEngine/RHI/D3D12/D3D12CommandQueue.h"
|
||||
|
||||
using namespace XCEngine::RHI;
|
||||
|
||||
TEST_F(D3D12TestFixture, CommandQueue_Get_TimestampFrequency) {
|
||||
D3D12_COMMAND_QUEUE_DESC desc = {};
|
||||
desc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
|
||||
|
||||
ComPtr<ID3D12CommandQueue> queue;
|
||||
HRESULT hr = GetDevice()->CreateCommandQueue(&desc, IID_PPV_ARGS(&queue));
|
||||
ASSERT_HRESULT_SUCCEEDED(hr);
|
||||
|
||||
UINT64 frequency;
|
||||
hr = queue->GetTimestampFrequency(&frequency);
|
||||
ASSERT_HRESULT_SUCCEEDED(hr);
|
||||
ASSERT_NE(GetCommandQueue(), nullptr);
|
||||
UINT64 frequency = GetCommandQueue()->GetTimestampFrequency();
|
||||
EXPECT_GT(frequency, 0);
|
||||
}
|
||||
|
||||
TEST_F(D3D12TestFixture, CommandQueue_Execute_EmptyCommandLists) {
|
||||
GetCommandList()->Reset(GetCommandAllocator(), nullptr);
|
||||
ID3D12CommandList* commandLists[] = { GetCommandList() };
|
||||
GetCommandList()->Reset();
|
||||
void* commandLists[] = { GetCommandList()->GetCommandList() };
|
||||
GetCommandQueue()->ExecuteCommandLists(1, commandLists);
|
||||
GetCommandList()->Close();
|
||||
WaitForGPU();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user