summaryrefslogtreecommitdiff
path: root/tests/fbo
diff options
context:
space:
mode:
authorFabian Bieler <fabianbieler@fastmail.fm>2017-12-21 11:46:10 +0100
committerFabian Bieler <fabianbieler@fastmail.fm>2018-01-03 22:40:52 +0100
commit6aa77c8d2ad57a1bdfad3559851292faf9d7da08 (patch)
tree02436168360a359752f3aa6a33ee1fe570e53334 /tests/fbo
parent4c6eab0bc4c8665b85c95b0a52630b9070055015 (diff)
Remove GLenum string literals.
Replace GLenum string literals with calls to piglit_get_gl_enum_name. This commit modifies all tests were the replacement is simple and straightforward. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'tests/fbo')
-rw-r--r--tests/fbo/fbo-integer.c36
-rw-r--r--tests/fbo/fbo-readpixels-depth-formats.c12
2 files changed, 24 insertions, 24 deletions
diff --git a/tests/fbo/fbo-integer.c b/tests/fbo/fbo-integer.c
index 0bd40adb3..08e4e153c 100644
--- a/tests/fbo/fbo-integer.c
+++ b/tests/fbo/fbo-integer.c
@@ -45,7 +45,6 @@ static GLint TexWidth = 256, TexHeight = 256;
struct format_info
{
- const char *Name;
GLenum IntFormat, BaseFormat;
GLuint BitsPerChannel;
GLboolean Signed;
@@ -54,19 +53,19 @@ struct format_info
static const struct format_info Formats[] = {
/* { "GL_RGBA", GL_RGBA, GL_RGBA, 8, GL_FALSE },*/
- { "GL_RGBA8I_EXT", GL_RGBA8I_EXT, GL_RGBA_INTEGER_EXT, 8, GL_TRUE },
- { "GL_RGBA8UI_EXT", GL_RGBA8UI_EXT , GL_RGBA_INTEGER_EXT, 8, GL_FALSE },
- { "GL_RGBA16I_EXT", GL_RGBA16I_EXT, GL_RGBA_INTEGER_EXT, 16, GL_TRUE },
- { "GL_RGBA16UI_EXT", GL_RGBA16UI_EXT, GL_RGBA_INTEGER_EXT, 16, GL_FALSE },
- { "GL_RGBA32I_EXT", GL_RGBA32I_EXT, GL_RGBA_INTEGER_EXT, 32, GL_TRUE },
- { "GL_RGBA32UI_EXT", GL_RGBA32UI_EXT, GL_RGBA_INTEGER_EXT, 32, GL_FALSE },
-
- { "GL_RGB8I_EXT", GL_RGB8I_EXT, GL_RGB_INTEGER_EXT, 8, GL_TRUE },
- { "GL_RGB8UI_EXT", GL_RGB8UI_EXT , GL_RGB_INTEGER_EXT, 8, GL_FALSE },
- { "GL_RGB16I_EXT", GL_RGB16I_EXT, GL_RGB_INTEGER_EXT, 16, GL_TRUE },
- { "GL_RGB16UI_EXT", GL_RGB16UI_EXT, GL_RGB_INTEGER_EXT, 16, GL_FALSE },
- { "GL_RGB32I_EXT", GL_RGB32I_EXT, GL_RGB_INTEGER_EXT, 32, GL_TRUE },
- { "GL_RGB32UI_EXT", GL_RGB32UI_EXT, GL_RGB_INTEGER_EXT, 32, GL_FALSE },
+ { GL_RGBA8I_EXT, GL_RGBA_INTEGER_EXT, 8, GL_TRUE },
+ { GL_RGBA8UI_EXT , GL_RGBA_INTEGER_EXT, 8, GL_FALSE },
+ { GL_RGBA16I_EXT, GL_RGBA_INTEGER_EXT, 16, GL_TRUE },
+ { GL_RGBA16UI_EXT, GL_RGBA_INTEGER_EXT, 16, GL_FALSE },
+ { GL_RGBA32I_EXT, GL_RGBA_INTEGER_EXT, 32, GL_TRUE },
+ { GL_RGBA32UI_EXT, GL_RGBA_INTEGER_EXT, 32, GL_FALSE },
+
+ { GL_RGB8I_EXT, GL_RGB_INTEGER_EXT, 8, GL_TRUE },
+ { GL_RGB8UI_EXT , GL_RGB_INTEGER_EXT, 8, GL_FALSE },
+ { GL_RGB16I_EXT, GL_RGB_INTEGER_EXT, 16, GL_TRUE },
+ { GL_RGB16UI_EXT, GL_RGB_INTEGER_EXT, 16, GL_FALSE },
+ { GL_RGB32I_EXT, GL_RGB_INTEGER_EXT, 32, GL_TRUE },
+ { GL_RGB32UI_EXT, GL_RGB_INTEGER_EXT, 32, GL_FALSE },
};
#define NUM_FORMATS (sizeof(Formats) / sizeof(Formats[0]))
@@ -191,6 +190,7 @@ test_fbo(const struct format_info *info)
const int max = get_max_val(info);
const int comps = num_components(info->BaseFormat);
const GLenum type = get_datatype(info);
+ const char *name = piglit_get_gl_enum_name(info->IntFormat);
GLint f;
GLuint fbo, texObj;
GLenum status;
@@ -198,7 +198,7 @@ test_fbo(const struct format_info *info)
GLint buf;
if (0)
- fprintf(stderr, "============ Testing format = %s ========\n", info->Name);
+ fprintf(stderr, "============ Testing format = %s ========\n", name);
/* Create texture */
glGenTextures(1, &texObj);
@@ -260,7 +260,7 @@ test_fbo(const struct format_info *info)
for (i = 0; i < comps; i++) {
if (pix[i] != clr[i]) {
fprintf(stderr, "%s: glClear failed\n", TestName);
- fprintf(stderr, " Texture format = %s\n", info->Name);
+ fprintf(stderr, " Texture format = %s\n", name);
fprintf(stderr, " Expected %d, %d, %d, %d\n",
clr[0], clr[1], clr[2], clr[3]);
fprintf(stderr, " Found %d, %d, %d, %d\n",
@@ -313,7 +313,7 @@ test_fbo(const struct format_info *info)
fprintf(stderr,
"%s: glDraw/ReadPixels failed at %d. Expected %d, found %d\n",
TestName, i, image[i], readback[i]);
- fprintf(stderr, "Texture format = %s\n", info->Name);
+ fprintf(stderr, "Texture format = %s\n", name);
assert(0);
return GL_FALSE;
}
@@ -365,7 +365,7 @@ test_fbo(const struct format_info *info)
abs(result[1] - value[1]) > error ||
abs(result[2] - value[2]) > error ||
abs(result[3] - value[3]) > error) {
- fprintf(stderr, "%s: failure with format %s:\n", TestName, info->Name);
+ fprintf(stderr, "%s: failure with format %s:\n", TestName, name);
fprintf(stderr, " input value = %d, %d, %d, %d\n",
value[0], value[1], value[2], value[3]);
fprintf(stderr, " result color = %d, %d, %d, %d\n",
diff --git a/tests/fbo/fbo-readpixels-depth-formats.c b/tests/fbo/fbo-readpixels-depth-formats.c
index 3830da074..d53ce9eac 100644
--- a/tests/fbo/fbo-readpixels-depth-formats.c
+++ b/tests/fbo/fbo-readpixels-depth-formats.c
@@ -161,13 +161,12 @@ test_unsigned_byte(int x, int y, void *values)
struct {
GLenum token;
- char *name;
bool (*test)(int x, int y, void *values);
} read_formats[] = {
- { GL_FLOAT, "GL_FLOAT", test_float },
- { GL_UNSIGNED_INT, "GL_UNSIGNED_INT", test_unsigned_int },
- { GL_UNSIGNED_SHORT, "GL_UNSIGNED_SHORT", test_unsigned_short },
- { GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE", test_unsigned_byte },
+ { GL_FLOAT, test_float },
+ { GL_UNSIGNED_INT, test_unsigned_int },
+ { GL_UNSIGNED_SHORT, test_unsigned_short },
+ { GL_UNSIGNED_BYTE, test_unsigned_byte },
};
static bool
@@ -243,7 +242,8 @@ test_with_format(GLenum internal_format, const char *name)
PIGLIT_PASS : PIGLIT_FAIL),
"%s/%s",
name,
- read_formats[i].name);
+ piglit_get_gl_enum_name(
+ read_formats[i].token));
pass = format_passed && pass;
}