[Chore] (MG_Test/ProgramTest): add more checks to ProgramTest

This commit is contained in:
2025-10-26 23:00:48 +08:00
parent 63295b5493
commit f951f0451f
+12
View File
@@ -207,6 +207,10 @@ TEST_F(ProgramTest, UniformMatrixFunctions) {
UseProgram(program);
int uniformCount = 0;
GetProgramiv(program, GL_ACTIVE_UNIFORMS, &uniformCount);
ASSERT_LT(uniformCount, 4000);
// Test UniformMatrix2fv
auto locProjMat = GetUniformLocation(program, "ProjMat");
ASSERT_NE(locProjMat, -1);
@@ -268,6 +272,10 @@ TEST_F(ProgramTest, UniformMatrixTranspose) {
UseProgram(program);
int uniformCount = 0;
GetProgramiv(program, GL_ACTIVE_UNIFORMS, &uniformCount);
ASSERT_LT(uniformCount, 4000);
// Test 2x2 matrix transpose
auto locMat2 = GetUniformLocation(program, "TestMat2");
ASSERT_NE(locMat2, -1);
@@ -428,6 +436,10 @@ TEST_F(ProgramTest, UniformLocationGaps) {
UseProgram(program);
int uniformCount = 0;
GetProgramiv(program, GL_ACTIVE_UNIFORMS, &uniformCount);
ASSERT_LT(uniformCount, 4000);
// Test that uniform locations are correctly assigned even with gaps
// ProjMat is at location 0
ASSERT_EQ(GetUniformLocation(program, "ProjMat"), 0);