diff options
Diffstat (limited to 'tests')
28 files changed, 51 insertions, 141 deletions
diff --git a/tests/bugs/fdo10370.c b/tests/bugs/fdo10370.c index caee31c4..08788d85 100644 --- a/tests/bugs/fdo10370.c +++ b/tests/bugs/fdo10370.c @@ -31,8 +31,6 @@ static GLuint tex_name; void init() { - int i, j; - glMatrixMode(GL_PROJECTION); glLoadIdentity(); glTranslatef(-1.0, -1.0, 0.0); @@ -66,7 +64,6 @@ void init() void display() { int i, j, k, col, pixel; - GLubyte zero_data = 0; GLfloat expected[4]; float dmax = 0.0; @@ -179,4 +176,6 @@ int main(int argc, char**argv) init(); glutDisplayFunc(display); glutMainLoop(); + + return 0; } diff --git a/tests/bugs/fdo14575.c b/tests/bugs/fdo14575.c index 5701eebf..42ce1a02 100644 --- a/tests/bugs/fdo14575.c +++ b/tests/bugs/fdo14575.c @@ -53,7 +53,7 @@ int main(int argc, char**argv) { GLfloat data = 1.0; GLfloat *v; - int buf; + GLuint buf; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) diff --git a/tests/bugs/fdo20701.c b/tests/bugs/fdo20701.c index d32ef367..1e8faec9 100644 --- a/tests/bugs/fdo20701.c +++ b/tests/bugs/fdo20701.c @@ -36,6 +36,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <GL/glew.h> #if defined(__APPLE__) diff --git a/tests/bugs/fdo9833.c b/tests/bugs/fdo9833.c index 15663a64..e78d27e0 100644 --- a/tests/bugs/fdo9833.c +++ b/tests/bugs/fdo9833.c @@ -5,6 +5,7 @@ #include <stdlib.h> #include <stdio.h> +#include <string.h> #if defined(__APPLE__) #include <GLUT/glut.h> #else diff --git a/tests/bugs/tex1d-2dborder.c b/tests/bugs/tex1d-2dborder.c index 82da55ef..9b41fcba 100644 --- a/tests/bugs/tex1d-2dborder.c +++ b/tests/bugs/tex1d-2dborder.c @@ -86,8 +86,6 @@ static void test(GLenum wrapt, int cellx, int celly) static void Redisplay(void) { - int x, y; - glClearColor(0.5, 0.5, 0.5, 1.0); glClear(GL_COLOR_BUFFER_BIT); @@ -150,7 +148,6 @@ static void Key(unsigned char key, int x, int y) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) Automatic = 1; diff --git a/tests/fbo/fbo-3d.c b/tests/fbo/fbo-3d.c index dfc5d274..2cc58cfc 100644 --- a/tests/fbo/fbo-3d.c +++ b/tests/fbo/fbo-3d.c @@ -71,27 +71,11 @@ static void rect(int x1, int y1, int x2, int y2) glEnd(); } -static void -report_fail(char *name, char *method, int x, int y, - GLfloat *results, GLfloat *expected) -{ - printf("%s vs %s: expected at (%d,%d): %f,%f,%f\n", - name, method, x, y, expected[0], expected[1], expected[2]); - printf("%s vs %s: results at (%d,%d): %f,%f,%f\n", - name, method, x, y, - results[0], results[1], results[2]); -} - static int create_3d_fbo(void) { - GLuint tex, fb, rb; + GLuint tex, fb; GLenum status; - GLboolean pass = GL_TRUE; - int subrect_w = BUF_WIDTH / 5; - int subrect_h = BUF_HEIGHT / 5; - int x, y; - int rbits, gbits, bbits, abits; int depth; glGenTextures(1, &tex); @@ -141,7 +125,7 @@ done: return tex; } -static GLboolean +static void draw_depth(int x, int y, int depth) { float depth_coord = (float)depth / (NUM_DEPTHS - 1); @@ -189,13 +173,16 @@ static GLboolean test_depth_drawing(int start_x, int start_y, float *expected) pass &= piglit_probe_pixel_rgb(x, y, expected); } } + + return pass; } static void display() { GLboolean pass = GL_TRUE; - int depth, tex; + int depth; + GLuint tex; glClearColor(1.0, 1.0, 1.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); @@ -205,7 +192,7 @@ display() for (depth = 0; depth < NUM_DEPTHS; depth++) { int x = 1 + depth * (BUF_WIDTH + 1); int y = 1; - pass &= draw_depth(x, y, depth); + draw_depth(x, y, depth); } for (depth = 0; depth < NUM_DEPTHS; depth++) { @@ -238,4 +225,6 @@ int main(int argc, char**argv) piglit_require_extension("GL_EXT_framebuffer_object"); glutMainLoop(); + + return 0; } diff --git a/tests/fbo/fbo-cubemap.c b/tests/fbo/fbo-cubemap.c index 2462ec70..03000ca1 100644 --- a/tests/fbo/fbo-cubemap.c +++ b/tests/fbo/fbo-cubemap.c @@ -76,28 +76,12 @@ static void rect(int x1, int y1, int x2, int y2) glEnd(); } -static void -report_fail(char *name, char *method, int x, int y, - GLfloat *results, GLfloat *expected) -{ - printf("%s vs %s: expected at (%d,%d): %f,%f,%f\n", - name, method, x, y, expected[0], expected[1], expected[2]); - printf("%s vs %s: results at (%d,%d): %f,%f,%f\n", - name, method, x, y, - results[0], results[1], results[2]); -} - static int create_cube_fbo(void) { - GLuint tex, fb, rb; + GLuint tex, fb; GLenum status; - GLboolean pass = GL_TRUE; - int subrect_w = BUF_WIDTH / 5; - int subrect_h = BUF_HEIGHT / 5; - int x, y; - int rbits, gbits, bbits, abits; - int face, dim, i; + int face, dim; glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_CUBE_MAP, tex); @@ -161,7 +145,7 @@ done: return tex; } -static GLboolean +static void draw_face(int x, int y, int dim, int face) { glViewport(0, 0, WIN_WIDTH, WIN_HEIGHT); @@ -207,13 +191,16 @@ static GLboolean test_face_drawing(int start_x, int start_y, int dim, pass &= piglit_probe_pixel_rgb(x, y, expected); } } + + return pass; } static void display() { GLboolean pass = GL_TRUE; - int face, tex, dim; + int face, dim; + GLuint tex; glClearColor(0.5, 0.5, 0.5, 0.5); glClear(GL_COLOR_BUFFER_BIT); @@ -225,7 +212,7 @@ display() int y = 1; for (dim = BUF_WIDTH; dim > 0; dim /= 2) { - pass &= draw_face(x, y, dim, face); + draw_face(x, y, dim, face); y += dim + 1; } } @@ -268,4 +255,6 @@ int main(int argc, char**argv) piglit_require_extension("GL_ARB_texture_cube_map"); glutMainLoop(); + + return 0; } diff --git a/tests/fbo/fbo-readpixels.c b/tests/fbo/fbo-readpixels.c index 0581cd5d..10d657ed 100644 --- a/tests/fbo/fbo-readpixels.c +++ b/tests/fbo/fbo-readpixels.c @@ -42,6 +42,8 @@ #include <stdio.h> #include <stdlib.h> +#include "piglit-util.h" + #define BUF_WIDTH 32 #define BUF_HEIGHT 32 #define WIN_WIDTH 100 @@ -59,22 +61,11 @@ static void rect(int x1, int y1, int x2, int y2) glEnd(); } -static void -report_fail(char *name, char *method, int x, int y, - GLfloat *results, GLfloat *expected) -{ - printf("%s vs %s: expected at (%d,%d): %f,%f,%f\n", - name, method, x, y, expected[0], expected[1], expected[2]); - printf("%s vs %s: results at (%d,%d): %f,%f,%f\n", - name, method, x, y, - results[0], results[1], results[2]); -} - static GLboolean test_with_format(GLenum internal_format, GLenum format, GLenum type, float results_x, float results_y) { - GLuint tex, fb, rb; + GLuint tex, fb; GLenum status; GLboolean pass = GL_TRUE; int subrect_w = BUF_WIDTH / 5; @@ -257,4 +248,6 @@ int main(int argc, char**argv) piglit_require_extension("GL_EXT_framebuffer_object"); glutMainLoop(); + + return 0; } diff --git a/tests/general/linestipple.c b/tests/general/linestipple.c index 41b21444..c7bf78f2 100644 --- a/tests/general/linestipple.c +++ b/tests/general/linestipple.c @@ -42,7 +42,6 @@ static int Width = 128, Height = 128; static int Automatic = 0; -static int CurrentTest = 0; static void probe_pixel(int x, int y, const float* expected) { @@ -234,7 +233,6 @@ static void Key(unsigned char key, int x, int y) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) Automatic = 1; diff --git a/tests/general/occlusion_query.c b/tests/general/occlusion_query.c index 1b987dac..f008bcd0 100644 --- a/tests/general/occlusion_query.c +++ b/tests/general/occlusion_query.c @@ -238,7 +238,6 @@ static void Key(unsigned char key, int x, int y) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) Automatic = 1; diff --git a/tests/general/texgen.c b/tests/general/texgen.c index ae4b22cc..c761fe64 100644 --- a/tests/general/texgen.c +++ b/tests/general/texgen.c @@ -261,7 +261,6 @@ static void Key(unsigned char key, int x, int y) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) Automatic = 1; diff --git a/tests/general/varray-disabled.c b/tests/general/varray-disabled.c index b704ab0a..188aa7cd 100644 --- a/tests/general/varray-disabled.c +++ b/tests/general/varray-disabled.c @@ -131,8 +131,6 @@ static void Redisplay(void) pass &= piglit_probe_pixel_rgb(Width * 3 / 6, Height / 2, black); pass &= piglit_probe_pixel_rgb(Width * 5 / 6, Height / 2, blue); if (Automatic) { - int i; - if (pass) piglit_report_result(PIGLIT_SUCCESS); else @@ -168,7 +166,6 @@ static void Key(unsigned char key, int x, int y) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) Automatic = 1; diff --git a/tests/general/windowoverlap.c b/tests/general/windowoverlap.c index 2f83cec5..d559cdde 100644 --- a/tests/general/windowoverlap.c +++ b/tests/general/windowoverlap.c @@ -49,7 +49,6 @@ static const int SubX = 32, SubY = 32; static const int SubWidth = 64, SubHeight = 64; static int Automatic = 0; -static int CurrentTest = 0; static int MainWindow; static int SubWindow; @@ -187,7 +186,6 @@ static void Key(unsigned char key, int x, int y) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) Automatic = 1; diff --git a/tests/shaders/fp-fragment-position.c b/tests/shaders/fp-fragment-position.c index 90d41245..e261b50f 100644 --- a/tests/shaders/fp-fragment-position.c +++ b/tests/shaders/fp-fragment-position.c @@ -37,11 +37,6 @@ #endif #include "piglit-util.h" -static void CheckFail(const char* cond); - -#define check(cond) do { if (!(cond)) CheckFail(#cond); } while(0) - - #define NUM_PROGRAMS 4 static GLuint FragProg[NUM_PROGRAMS]; @@ -96,8 +91,6 @@ static int Width = 200, Height = 200; */ static void DoFrame(void) { - int mask; - printf("rgba: %i %i %i %i\n", glutGet(GLUT_WINDOW_RED_SIZE), glutGet(GLUT_WINDOW_GREEN_SIZE), @@ -407,14 +400,6 @@ static void Init(void) Reshape(Width,Height); } -static void CheckFail(const char* cond) -{ - fprintf(stderr, "Check failed: %s\n", cond); - if (Automatic) - printf("PIGLIT: {'result': 'fail' }\n"); - abort(); -} - int main(int argc, char *argv[]) { glutInit(&argc, argv); diff --git a/tests/shaders/fp-generic.c b/tests/shaders/fp-generic.c index 47f6423c..f5913b51 100644 --- a/tests/shaders/fp-generic.c +++ b/tests/shaders/fp-generic.c @@ -112,8 +112,6 @@ static void readTestcase(struct testcase* tc, const char* filename) for(i = 0; i < tc->nrInstances; ++i) { struct testinstance* inst = tc->instances + i; - char buffer[41]; - int j; expect(filp, "tc"); inst->texcoords = readfloatarray(filp, tc->nrTexCoords*4); diff --git a/tests/shaders/fp-incomplete-tex.c b/tests/shaders/fp-incomplete-tex.c index c40bb50c..ed2229ef 100644 --- a/tests/shaders/fp-incomplete-tex.c +++ b/tests/shaders/fp-incomplete-tex.c @@ -39,11 +39,6 @@ #include "piglit-util.h" -static void CheckFail(const char* cond); - -#define check(cond) do { if (!(cond)) CheckFail(#cond); } while(0) - - #define NUM_PROGRAMS 5 static GLuint FragProg[NUM_PROGRAMS]; @@ -76,7 +71,6 @@ static int Width = 300, Height = 200; static void DoFrame(void) { - int mask; int i; glClearColor(0.3, 0.3, 0.3, 0.3); @@ -234,9 +228,7 @@ static void Key(unsigned char key, int x, int y) static void Init(void) { - int i, x, y; - GLubyte rectangle[200][200][4]; - GLubyte tex[256][256][4]; + int i; printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); @@ -248,14 +240,6 @@ static void Init(void) Reshape(Width,Height); } -static void CheckFail(const char* cond) -{ - fprintf(stderr, "Check failed: %s\n", cond); - if (Automatic) - printf("PIGLIT: {'result': 'fail' }\n"); - abort(); -} - int main(int argc, char *argv[]) { glutInit(&argc, argv); diff --git a/tests/shaders/fp-indirections.c b/tests/shaders/fp-indirections.c index 8e09a222..d7273925 100644 --- a/tests/shaders/fp-indirections.c +++ b/tests/shaders/fp-indirections.c @@ -121,12 +121,12 @@ static char *gen_temporary_source_indirections(int sample_count, char *pre = "!!ARBfp1.0\n" "TEMP val, val2, sample, sample2;\n" - "MOV val, fragment.color;\n"; + "MOV val, fragment.color;\n" "MOV val2, fragment.color;\n"; char *sample = "TEX sample, val, texture[0], 2D;\n" "TEX sample2, val2, texture[1], 2D;\n" - "MUL val, sample, sample2;\n"; + "MUL val, sample, sample2;\n" "MUL val2, val2, val;\n"; char *post = "MOV result.color, val;\n" @@ -274,8 +274,6 @@ void display(void) void init(void) { - GLboolean pass = GL_FALSE; - piglit_require_fragment_program(); glEnable(GL_FRAGMENT_PROGRAM_ARB); diff --git a/tests/shaders/fp-kil.c b/tests/shaders/fp-kil.c index a0b82f4f..8e5619fe 100644 --- a/tests/shaders/fp-kil.c +++ b/tests/shaders/fp-kil.c @@ -37,11 +37,6 @@ #endif #include "piglit-util.h" -static void CheckFail(const char* cond); - -#define check(cond) do { if (!(cond)) CheckFail(#cond); } while(0) - - #define NUM_PROGRAMS 2 static GLuint FragProg[NUM_PROGRAMS]; @@ -68,8 +63,6 @@ static int Width = 200, Height = 200; // space for more tests static void DoFrame(void) { - int mask; - glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -347,14 +340,6 @@ static void Init(void) Reshape(Width,Height); } -static void CheckFail(const char* cond) -{ - fprintf(stderr, "Check failed: %s\n", cond); - if (Automatic) - printf("PIGLIT: {'result': 'fail' }\n"); - abort(); -} - int main(int argc, char *argv[]) { glutInit(&argc, argv); diff --git a/tests/shaders/fp-lit-mask.c b/tests/shaders/fp-lit-mask.c index 59f89688..0cbbf747 100644 --- a/tests/shaders/fp-lit-mask.c +++ b/tests/shaders/fp-lit-mask.c @@ -174,7 +174,6 @@ static void Init(void) * Fragment programs */ for(mask = 1; mask < 16; ++mask) { - GLint errorPos; char programText[1024]; char maskstring[5]; diff --git a/tests/shaders/trinity-fp1.c b/tests/shaders/trinity-fp1.c index d02eeab7..7cb98b6e 100644 --- a/tests/shaders/trinity-fp1.c +++ b/tests/shaders/trinity-fp1.c @@ -203,7 +203,6 @@ static void Key(unsigned char key, int x, int y) static void Init(void) { - GLint errorPos; GLubyte data[256][256][4]; int x,y; diff --git a/tests/texturing/cubemap.c b/tests/texturing/cubemap.c index c381f772..ab825ce1 100644 --- a/tests/texturing/cubemap.c +++ b/tests/texturing/cubemap.c @@ -131,8 +131,6 @@ static GLboolean test_results(int x, int y, int size, int level, int face, GLboolean mipmapped, int color) { - GLfloat pix[4]; - GLfloat probe[4]; GLfloat *color1 = colors[color]; GLfloat *color2 = colors[(color + 1) % ARRAY_SIZE(colors)]; GLboolean pass = GL_TRUE; @@ -163,7 +161,7 @@ draw_at_size(int size, GLboolean mipmapped) GLfloat row_y = PAD; int dim, face; int color = 0, level = 0; - GLint texname; + GLuint texname; GLboolean pass = GL_TRUE; /* Create the texture. */ @@ -351,4 +349,6 @@ int main(int argc, char**argv) glutKeyboardFunc(Key); } glutMainLoop(); + + return 0; } diff --git a/tests/texturing/gen-teximage.c b/tests/texturing/gen-teximage.c index 2a9607f0..0f950f0f 100644 --- a/tests/texturing/gen-teximage.c +++ b/tests/texturing/gen-teximage.c @@ -108,7 +108,7 @@ static void display() { const GLfloat red[4] = {1.0, 0.0, 0.0, 0.0}; const GLfloat blue[4] = {0.0, 0.0, 1.0, 0.0}; - GLint texture; + GLuint texture; int i; glClearColor(0, 0, 0, 0); @@ -160,7 +160,6 @@ static void display() glFlush(); if (Automatic) { - int dim; GLboolean pass = GL_TRUE; pass = pass && check_resulting_mipmaps(0, 0, red); @@ -210,4 +209,6 @@ int main(int argc, char**argv) init(); glutDisplayFunc(display); glutMainLoop(); + + return 0; } diff --git a/tests/texturing/gen-texsubimage.c b/tests/texturing/gen-texsubimage.c index a3cfaac7..250dc360 100644 --- a/tests/texturing/gen-texsubimage.c +++ b/tests/texturing/gen-texsubimage.c @@ -86,7 +86,7 @@ static void display() GLfloat *data; const GLfloat red[4] = {1.0, 0.0, 0.0, 0.0}; const GLfloat blue[4] = {0.0, 0.0, 1.0, 0.0}; - GLint texture; + GLuint texture; int i; glClearColor(0, 0, 0, 0); @@ -140,7 +140,6 @@ static void display() glFlush(); if (Automatic) { - int dim; GLboolean pass = GL_TRUE; pass = pass && check_resulting_mipmaps(0, 0, blue); @@ -189,4 +188,6 @@ int main(int argc, char**argv) init(); glutDisplayFunc(display); glutMainLoop(); + + return 0; } diff --git a/tests/texturing/lodbias.c b/tests/texturing/lodbias.c index 42020b2f..a6e75532 100644 --- a/tests/texturing/lodbias.c +++ b/tests/texturing/lodbias.c @@ -330,7 +330,6 @@ static void Key(unsigned char key, int x, int y) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) Automatic = 1; diff --git a/tests/texturing/tex3d.c b/tests/texturing/tex3d.c index 71af6e5a..588bb1a6 100644 --- a/tests/texturing/tex3d.c +++ b/tests/texturing/tex3d.c @@ -240,7 +240,6 @@ static void Init(void) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); glutInitWindowPosition(0, 0); glutInitWindowSize(Width, Height); diff --git a/tests/texturing/texdepth.c b/tests/texturing/texdepth.c index 594f648a..87b1055d 100644 --- a/tests/texturing/texdepth.c +++ b/tests/texturing/texdepth.c @@ -386,7 +386,6 @@ static void Key(unsigned char key, int x, int y) static void init() { GLfloat texbuf[4]; - int i; piglit_require_extension("GL_ARB_depth_texture"); HaveShadow = glutExtensionSupported("GL_ARB_shadow"); diff --git a/tests/texturing/texredefine.c b/tests/texturing/texredefine.c index 5b549ed9..7c3d0e8f 100644 --- a/tests/texturing/texredefine.c +++ b/tests/texturing/texredefine.c @@ -43,7 +43,6 @@ static int Width = 128, Height = 128; static int Automatic = 0; -static int CurrentTest = 0; static const int CellSize = 8; /* see cell_coords */ @@ -240,7 +239,6 @@ static void Key(unsigned char key, int x, int y) int main(int argc, char *argv[]) { - int i; glutInit(&argc, argv); if (argc == 2 && !strcmp(argv[1], "-auto")) Automatic = 1; diff --git a/tests/texturing/tfp.c b/tests/texturing/tfp.c index e93661b5..a1d23d6e 100644 --- a/tests/texturing/tfp.c +++ b/tests/texturing/tfp.c @@ -94,12 +94,14 @@ check_results(GLboolean has_alpha, int x, int y, int w, int h) x + w * 1 / 4, y + h * 3 / 4); pass &= check_pixel(has_alpha, tex_data[3], x + w * 3 / 4, y + h * 3 / 4); + + return pass; } static void draw_pixmap(GLXPixmap pixmap, int x, int y, int w, int h) { - GLint texname; + GLuint texname; GLfloat tex_coords[] = { 0.0f, 0.0f, 1.0f, 0.0f, @@ -353,7 +355,6 @@ event_loop () int main(int argc, char**argv) { - XSetWindowAttributes attr; unsigned long mask; XVisualInfo *visinfo; int attrib[] = { @@ -367,6 +368,7 @@ int main(int argc, char**argv) XSetWindowAttributes window_attr; GLXContext ctx; int i; + const char *glx_extension_list; const GLubyte *extension_list; int screen; Window root_win; @@ -420,14 +422,15 @@ int main(int argc, char**argv) /* This is a bogus way of checking for the extension. * Needs more GLEW. */ - extension_list = glXQueryExtensionsString(dpy, screen); - if (strstr(extension_list, "GLX_EXT_texture_from_pixmap") == NULL) { + glx_extension_list = glXQueryExtensionsString(dpy, screen); + if (strstr(glx_extension_list, "GLX_EXT_texture_from_pixmap") == NULL) { fprintf(stderr, "Test requires GLX_EXT_texture_from_pixmap\n"); piglit_report_result(PIGLIT_SKIP); exit(1); } extension_list = glGetString(GL_EXTENSIONS); - if (strstr(extension_list, "GL_ARB_texture_env_combine") == NULL) { + if (strstr((const char *)extension_list, + "GL_ARB_texture_env_combine") == NULL) { fprintf(stderr, "Test requires GL_ARB_texture_env_combine\n"); piglit_report_result(PIGLIT_SKIP); exit(1); @@ -453,4 +456,6 @@ int main(int argc, char**argv) } event_loop(); + + return 0; } |