Fix some dEQP GLES2 issues.
authorJarkko Pöyry <jpoyry@google.com>
Mon, 10 Nov 2014 18:58:55 +0000 (10:58 -0800)
committerJarkko Pöyry <jpoyry@google.com>
Mon, 10 Nov 2014 18:58:55 +0000 (10:58 -0800)
- Convert broken negative preprocessor case to a positive one.
- Improve logging in negative shader matrix cases.

Bug: 18290570
Change-Id: If7e1a67a46021740f1c930cdda684bd85dd813be

data/gles2/shaders/preprocessor.test
modules/gles2/functional/es2fNegativeShaderApiTests.cpp

index 03f0193..593f37f 100644 (file)
@@ -112,6 +112,21 @@ group basic "Basic Tests"
                ""
        end
 
+       case identifier_with_double_underscore
+               values { output float out0 = 1.0; }
+               both ""
+                       precision mediump float;
+                       ${DECLARATIONS}
+                       # define __VALUE__      1
+
+                       void main()
+                       {
+                               // __VALUE__ not used since it might be set by an "underlying software layer"
+                               out0 = float(1.0);
+                               ${OUTPUT}
+                       }
+               ""
+       end
 end # basic
 
 group definitions "Symbol Definition Tests"
@@ -559,19 +574,6 @@ end # object_redefinitions
 
 group invalid_redefinitions "Invalid Redefinitions Tests"
 
-       case invalid_identifier_1
-               expect compile_fail
-               both ""
-                       precision mediump float;
-                       # define __VALUE__      1
-
-                       void main()
-                       {
-                               ${POSITION_FRAG_COLOR} = vec4(__VALUE__);
-                       }
-               ""
-       end
-
        case invalid_identifier_2
                expect compile_fail
                both ""
index a273bca..51cffc6 100644 (file)
@@ -898,6 +898,8 @@ void NegativeShaderApiTests::init (void)
                        GLint vMatUnif          = glGetUniformLocation(program.getProgram(), "vMatrix");        // mat4
                        GLint fSamplerUnif      = glGetUniformLocation(program.getProgram(), "fSampler");       // sampler2D
 
+                       m_log << program;
+
                        if (vMatUnif == -1 || fSamplerUnif == -1)
                        {
                                m_log << TestLog::Message << "// ERROR: Failed to retrieve uniform location" << TestLog::EndMessage;
@@ -929,6 +931,8 @@ void NegativeShaderApiTests::init (void)
                        glu::ShaderProgram program(m_context.getRenderContext(), glu::makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
                        glUseProgram(program.getProgram());
 
+                       m_log << program;
+
                        std::vector<GLfloat> data(16);
 
                        m_log << tcu::TestLog::Section("", "GL_INVALID_OPERATION is generated if location is an invalid uniform location for the current program object and location is not equal to -1.");
@@ -957,6 +961,8 @@ void NegativeShaderApiTests::init (void)
                        glUseProgram(program.getProgram());
                        GLint vMatUnif          = glGetUniformLocation(program.getProgram(), "vMatrix");                // mat4
 
+                       m_log << program;
+
                        if (vMatUnif == -1)
                        {
                                m_log << TestLog::Message << "// ERROR: Failed to retrieve uniform location" << TestLog::EndMessage;
@@ -983,6 +989,8 @@ void NegativeShaderApiTests::init (void)
                        glu::ShaderProgram program(m_context.getRenderContext(), glu::makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
                        glUseProgram(program.getProgram());
 
+                       m_log << program;
+
                        std::vector<GLfloat> data(16);
 
                        m_log << tcu::TestLog::Section("", "GL_INVALID_VALUE is generated if transpose is not GL_FALSE.");