Added missing tests to reach planned 56: - CommandList: EnableDisable_DepthTest, EnableDisable_Blending - RTV: GetTexture, GetMipLevel - DSV: Initialize_Texture, GetTexture, GetMipLevel Final count: 56 tests across all 12 components
61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
#include "fixtures/OpenGLTestFixture.h"
|
|
#include "XCEngine/RHI/OpenGL/OpenGLDepthStencilView.h"
|
|
#include "XCEngine/RHI/OpenGL/OpenGLTexture.h"
|
|
|
|
using namespace XCEngine::RHI;
|
|
|
|
TEST_F(OpenGLTestFixture, DepthStencilView_Bind_Unbind) {
|
|
OpenGLDepthStencilView dsv;
|
|
dsv.Initialize(0);
|
|
|
|
dsv.Bind();
|
|
GLint boundFBO = 0;
|
|
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &boundFBO);
|
|
|
|
dsv.Unbind();
|
|
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &boundFBO);
|
|
|
|
dsv.Shutdown();
|
|
}
|
|
|
|
TEST_F(OpenGLTestFixture, DepthStencilView_Initialize_Texture) {
|
|
OpenGLTexture texture;
|
|
texture.Initialize2D(64, 64, 4, nullptr, false);
|
|
|
|
OpenGLDepthStencilView dsv;
|
|
bool result = dsv.Initialize(texture.GetID());
|
|
|
|
if (result) {
|
|
EXPECT_NE(dsv.GetFramebuffer(), 0u);
|
|
dsv.Shutdown();
|
|
}
|
|
|
|
texture.Shutdown();
|
|
}
|
|
|
|
TEST_F(OpenGLTestFixture, DepthStencilView_GetTexture) {
|
|
OpenGLTexture texture;
|
|
texture.Initialize2D(64, 64, 4, nullptr, false);
|
|
|
|
OpenGLDepthStencilView dsv;
|
|
dsv.Initialize(texture.GetID());
|
|
|
|
EXPECT_EQ(dsv.GetTexture(), texture.GetID());
|
|
|
|
dsv.Shutdown();
|
|
texture.Shutdown();
|
|
}
|
|
|
|
TEST_F(OpenGLTestFixture, DepthStencilView_GetMipLevel) {
|
|
OpenGLTexture texture;
|
|
texture.Initialize2D(64, 64, 4, nullptr, false);
|
|
|
|
OpenGLDepthStencilView dsv;
|
|
dsv.Initialize(texture.GetID(), 2);
|
|
|
|
EXPECT_EQ(dsv.GetMipLevel(), 2);
|
|
|
|
dsv.Shutdown();
|
|
texture.Shutdown();
|
|
}
|