fix(test): zero-initialize state structs to avoid stack corruption

This commit is contained in:
2026-03-17 23:29:31 +08:00
parent 6fe21710e8
commit b7feca59c4

View File

@@ -150,7 +150,7 @@ TEST_F(OpenGLTestFixture, CommandList_SetPrimitiveTopology) {
TEST_F(OpenGLTestFixture, CommandList_SetDepthStencilState) {
OpenGLCommandList cmdList;
DepthStencilState state;
DepthStencilState state = {};
state.depthEnable = true;
state.depthWriteMask = true;
state.depthFunc = ComparisonFunc::Less;
@@ -165,7 +165,7 @@ TEST_F(OpenGLTestFixture, CommandList_SetDepthStencilState) {
TEST_F(OpenGLTestFixture, CommandList_SetBlendState) {
OpenGLCommandList cmdList;
BlendState state;
BlendState state = {};
state.renderTargets[0].blendEnable = true;
state.renderTargets[0].srcBlend = BlendFactor::SrcAlpha;
state.renderTargets[0].dstBlend = BlendFactor::InvSrcAlpha;