Fix valgrind warnings in negative tests when running on null context.
authorJarkko Pöyry <jpoyry@google.com>
Thu, 26 Mar 2015 20:15:23 +0000 (13:15 -0700)
committerJarkko Pöyry <jpoyry@google.com>
Thu, 26 Mar 2015 20:15:23 +0000 (13:15 -0700)
Change-Id: Ic58c2a34199be4436e59779c1cd78b8c49f8b037

modules/gles31/functional/es31fNegativeShaderApiTests.cpp
modules/gles31/functional/es31fNegativeStateApiTests.cpp

index e0d5a6e..a35b941 100644 (file)
@@ -555,8 +555,8 @@ void get_sampler_parameteriv (NegativeTestContext& ctx)
 
 void get_sampler_parameterfv (NegativeTestContext& ctx)
 {
-       float                   params;
-       GLuint                  sampler = 0;
+       float                           params  = 0.0f;
+       GLuint                          sampler = 0;
        ctx.glGenSamplers       (1, &sampler);
 
        ctx.beginSection("GL_INVALID_OPERATION is generated if sampler is not the name of a sampler object returned from a previous call to ctx.glGenSamplers.");
index 53a42b9..8f07c11 100644 (file)
@@ -335,10 +335,10 @@ void get_programiv (NegativeTestContext& ctx)
 
 void get_program_info_log (NegativeTestContext& ctx)
 {
-       GLuint program  = ctx.glCreateProgram();
-       GLuint shader   = ctx.glCreateShader(GL_VERTEX_SHADER);
-       GLsizei length[1];
-       char infoLog[1];
+       GLuint  program         = ctx.glCreateProgram();
+       GLuint  shader          = ctx.glCreateShader(GL_VERTEX_SHADER);
+       GLsizei length[1]       = { 0 };
+       char    infoLog[1]      = { 'x' };
 
        ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
        ctx.glGetProgramInfoLog (-1, 1, &length[0], &infoLog[0]);