chore: snapshot editor work and restore tests

Key points:\n- restore the tests tree removed by bc47e6e\n- capture current editor workspace, scene, and docs reshuffle changes\n- keep local cloud.nvdb resources ignored from this commit
This commit is contained in:
2026-04-25 22:11:47 +08:00
parent 9ab1beb2c4
commit 12b71a319f
911 changed files with 3518184 additions and 1823 deletions

View File

@@ -0,0 +1,65 @@
#include "fixtures/OpenGLTestFixture.h"
#include "XCEngine/RHI/OpenGL/OpenGLRenderTargetView.h"
#include "XCEngine/RHI/OpenGL/OpenGLTexture.h"
using namespace XCEngine::RHI;
TEST_F(OpenGLTestFixture, RenderTargetView_Initialize_Texture2D) {
OpenGLTexture texture;
texture.Initialize2D(64, 64, 4, nullptr, false);
OpenGLRenderTargetView rtv;
bool result = rtv.Initialize(texture.GetID());
ASSERT_TRUE(result);
EXPECT_NE(rtv.GetFramebuffer(), 0u);
rtv.Shutdown();
texture.Shutdown();
}
TEST_F(OpenGLTestFixture, RenderTargetView_Bind_Unbind) {
OpenGLTexture texture;
texture.Initialize2D(64, 64, 4, nullptr, false);
OpenGLRenderTargetView rtv;
rtv.Initialize(texture.GetID());
rtv.Bind();
GLint boundFBO = 0;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &boundFBO);
EXPECT_NE(boundFBO, 0);
rtv.Unbind();
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &boundFBO);
EXPECT_EQ(boundFBO, 0);
rtv.Shutdown();
texture.Shutdown();
}
TEST_F(OpenGLTestFixture, RenderTargetView_GetTexture) {
OpenGLTexture texture;
texture.Initialize2D(64, 64, 4, nullptr, false);
OpenGLRenderTargetView rtv;
rtv.Initialize(texture.GetID());
EXPECT_EQ(rtv.GetTexture(), texture.GetID());
rtv.Shutdown();
texture.Shutdown();
}
TEST_F(OpenGLTestFixture, RenderTargetView_GetMipLevel) {
OpenGLTexture texture;
texture.Initialize2D(64, 64, 4, nullptr, false);
OpenGLRenderTargetView rtv;
rtv.Initialize(texture.GetID(), 0);
EXPECT_EQ(rtv.GetMipLevel(), 0);
rtv.Shutdown();
texture.Shutdown();
}