From f951f0451fee000795ca4293416cf980bd50a8a8 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sun, 26 Oct 2025 23:00:48 +0800 Subject: [PATCH] [Chore] (MG_Test/ProgramTest): add more checks to ProgramTest --- MobileGL/MG_Test/Program/ProgramTest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MobileGL/MG_Test/Program/ProgramTest.cpp b/MobileGL/MG_Test/Program/ProgramTest.cpp index 214e99cb..41af7564 100644 --- a/MobileGL/MG_Test/Program/ProgramTest.cpp +++ b/MobileGL/MG_Test/Program/ProgramTest.cpp @@ -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);