[Piglit] [PATCH 09/17] glean: Replace gluErrorString with piglit_get_gl_error_name

Ian Romanick idr at freedesktop.org
Tue Sep 22 08:36:34 PDT 2015


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/glean/glutils.cpp       |  2 +-
 tests/glean/tfbo.cpp          | 15 ++++++++-------
 tests/glean/tpixelformats.cpp |  3 ++-
 tests/glean/tshaderapi.cpp    |  5 +++--
 tests/glean/ttexture_srgb.cpp |  3 ++-
 5 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/tests/glean/glutils.cpp b/tests/glean/glutils.cpp
index 29b4cfe..a7d6bfa 100644
--- a/tests/glean/glutils.cpp
+++ b/tests/glean/glutils.cpp
@@ -117,7 +117,7 @@ void
 logGLErrors(Environment& env) {
 	GLenum err;
 	while ((err = glGetError()))
-		env.log << "\tOpenGL error: " << gluErrorString(err) << '\n';
+		env.log << "\tOpenGL error: " << piglit_get_gl_error_name(err) << '\n';
 } // logGLErrors
 
 } // namespace GLUtils
diff --git a/tests/glean/tfbo.cpp b/tests/glean/tfbo.cpp
index fcf457f..eb3092e 100644
--- a/tests/glean/tfbo.cpp
+++ b/tests/glean/tfbo.cpp
@@ -39,6 +39,7 @@
 #include <cassert>
 #include <math.h>
 #include <cstring>
+#include "piglit-util-gl.h"
 
 namespace GLEAN
 {
@@ -437,7 +438,7 @@ FBOTest::testRender2SingleTexture(void)
                                                          &params);
                                                 if (params != TEXSIZE) {
                                                         REPORT_FAILURE("Get Renderbuffer width failed");
-                                                        printf("glGetRenderbufferParameterivEXT: %s\n", gluErrorString(glGetError()));
+                                                        printf("glGetRenderbufferParameterivEXT: %s\n", piglit_get_gl_error_name(glGetError()));
                                                         printf("width = %d\n", params);
                                                         return false;
                                                 }
@@ -447,7 +448,7 @@ FBOTest::testRender2SingleTexture(void)
                                                          &params);
                                                 if (params != height) {
                                                         REPORT_FAILURE("Get Renderbuffer height failed");
-                                                        printf("glGetRenderbufferParameterivEXT: %s\n", gluErrorString(glGetError()));
+                                                        printf("glGetRenderbufferParameterivEXT: %s\n", piglit_get_gl_error_name(glGetError()));
                                                         return false;
                                                 }
                                         }
@@ -474,7 +475,7 @@ FBOTest::testRender2SingleTexture(void)
                                                          &type);
                                                 if (type != GL_RENDERBUFFER_EXT) {
                                                         REPORT_FAILURE("Get Framebuffer attached object type failed");
-                                                        printf("glGetFramebufferParameterivEXT: %s\n", gluErrorString(glGetError()));
+                                                        printf("glGetFramebufferParameterivEXT: %s\n", piglit_get_gl_error_name(glGetError()));
                                                         printf("type = %d\n", type);
                                                         return false;
                                                 }
@@ -497,7 +498,7 @@ FBOTest::testRender2SingleTexture(void)
                                                          &name);
                                                 if ((GLuint)name != textures[0]) {
                                                         REPORT_FAILURE("Get Framebuffer attached texture name failed");
-                                                        printf("glGetFramebufferParameterivEXT: %s\n", gluErrorString(glGetError()));
+                                                        printf("glGetFramebufferParameterivEXT: %s\n", piglit_get_gl_error_name(glGetError()));
                                                         printf("name = %d\n", name);
                                                         return false;
                                                 }
@@ -519,7 +520,7 @@ FBOTest::testRender2SingleTexture(void)
                                                          &level);
                                                 if (level != 0) {
                                                         REPORT_FAILURE("Get Framebuffer attached texture level failed");
-                                                        printf("glGetFramebufferParameterivEXT: %s\n", gluErrorString(glGetError()));
+                                                        printf("glGetFramebufferParameterivEXT: %s\n", piglit_get_gl_error_name(glGetError()));
                                                         printf("level = %d\n", level);
                                                         return false;
                                                 }
@@ -545,7 +546,7 @@ FBOTest::testRender2SingleTexture(void)
 
                                                 if (zoffset != maxzoffset-1) {
                                                         REPORT_FAILURE("Get Framebuffer attached 3D texture z-offset failed");
-                                                        printf("glGetFramebufferParameterivEXT: %s\n", gluErrorString(glGetError()));
+                                                        printf("glGetFramebufferParameterivEXT: %s\n", piglit_get_gl_error_name(glGetError()));
                                                         printf("zoffset = %d\n", zoffset);
                                                         return false;
                                                 }
@@ -567,7 +568,7 @@ FBOTest::testRender2SingleTexture(void)
                                                     GL_TEXTURE_CUBE_MAP_POSITIVE_Z)
                                                 {
                                                         REPORT_FAILURE("Get Framebuffer attached cube map face failed");
-                                                        printf("glGetFramebufferParameterivEXT: %s\n", gluErrorString(glGetError()));
+                                                        printf("glGetFramebufferParameterivEXT: %s\n", piglit_get_gl_error_name(glGetError()));
                                                         printf("face = %d\n", face);
                                                        return false;
                                                 }
diff --git a/tests/glean/tpixelformats.cpp b/tests/glean/tpixelformats.cpp
index 9943e73..d9818dc 100644
--- a/tests/glean/tpixelformats.cpp
+++ b/tests/glean/tpixelformats.cpp
@@ -32,6 +32,7 @@
 #include <cmath>
 #include "tpixelformats.h"
 #include "../util/rgb9e5.h"
+#include "piglit-util-gl.h"
 
 
 // Set to 1 to help debug test failures:
@@ -890,7 +891,7 @@ PixelFormatsTest::CheckError(const char *where) const
 	if (err) {
 		char msg[1000];
 		sprintf(msg, "GL Error: %s (0x%x) in %s\n",
-				gluErrorString(err), err, where);
+				piglit_get_gl_error_name(err), err, where);
 		env->log << msg;
 		return true;
 	}
diff --git a/tests/glean/tshaderapi.cpp b/tests/glean/tshaderapi.cpp
index 64db544..623562a 100644
--- a/tests/glean/tshaderapi.cpp
+++ b/tests/glean/tshaderapi.cpp
@@ -35,6 +35,7 @@
 #include "tshaderapi.h"
 #include "rand.h"
 #include "image.h"
+#include "piglit-util-gl.h"
 
 
 namespace GLEAN {
@@ -66,7 +67,7 @@ ShaderAPITest::assert_no_error_test(const char *file, int line)
 	if (err != GL_NO_ERROR) {
 		error = true;
 		fprintf(stderr, "%s:%d received error %s\n",
-				file, line, gluErrorString(err));
+				file, line, piglit_get_gl_error_name(err));
 	}
 }
 
@@ -81,7 +82,7 @@ ShaderAPITest::assert_error_test(const char *file, int line, GLenum expect)
 	err = glGetError();
 	if (err != expect) {
 		fprintf(stderr, "%s:%d expected %s but received %s\n",
-				file, line, gluErrorString(expect), gluErrorString(err));
+				file, line, piglit_get_gl_error_name(expect), piglit_get_gl_error_name(err));
 		error = true;
 	}
 
diff --git a/tests/glean/ttexture_srgb.cpp b/tests/glean/ttexture_srgb.cpp
index 62688cb..524685f 100644
--- a/tests/glean/ttexture_srgb.cpp
+++ b/tests/glean/ttexture_srgb.cpp
@@ -35,6 +35,7 @@
 #include <cmath>
 #include "ttexture_srgb.h"
 #include "rand.h"
+#include "piglit-util-gl.h"
 
 
 namespace GLEAN {
@@ -307,7 +308,7 @@ TextureSRGBTest::logOne(TextureSRGBResult &r)
 	else {
 		env->log << name << " FAIL\n";
 		if (errorCode) {
-			env->log << "\tOpenGL Error " << gluErrorString(errorCode)
+			env->log << "\tOpenGL Error " << piglit_get_gl_error_name(errorCode)
 				 << " at " << errorPos << "\n";
 		}
 		else if (errorMsg[0]) {
-- 
2.1.0



More information about the Piglit mailing list