[Piglit] [PATCH 1/2] fbo-integer-readpixels-sint-uint: Fix reporting of errors.

Eric Anholt eric at anholt.net
Thu Nov 3 23:28:53 PDT 2011


We were reporting each failing pixel once per bad channel, but still
printing PIGLIT: {'result': 'pass' }.
---
 .../fbo-integer-readpixels-sint-uint.c             |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/spec/ext_texture_integer/fbo-integer-readpixels-sint-uint.c b/tests/spec/ext_texture_integer/fbo-integer-readpixels-sint-uint.c
index 0596740..50d3be6 100644
--- a/tests/spec/ext_texture_integer/fbo-integer-readpixels-sint-uint.c
+++ b/tests/spec/ext_texture_integer/fbo-integer-readpixels-sint-uint.c
@@ -143,7 +143,7 @@ check_error(const char *file, int line)
 
 
 /** \return GL_TRUE for pass, GL_FALSE for fail */
-static GLboolean
+static bool
 test_fbo(const struct format_info *info)
 {
    const int comps = num_components(info->BaseFormat);
@@ -153,6 +153,7 @@ test_fbo(const struct format_info *info)
    GLenum status;
    GLboolean intMode;
    GLint buf;
+   bool pass = true;
 
    if (0)
       fprintf(stderr, "============ Testing format = %s ========\n", info->Name);
@@ -235,6 +236,8 @@ test_fbo(const struct format_info *info)
                         exp_ui[0], exp_ui[1], exp_ui[2], exp_ui[3]);
                    fprintf(stderr, "  Found %u, %u, %u, %u\n",
                         pix_ui[0], pix_ui[1], pix_ui[2], pix_ui[3]);
+		   pass = false;
+		   break;
                }
           }
       } else {
@@ -246,6 +249,8 @@ test_fbo(const struct format_info *info)
                         exp_i[0], exp_i[1], exp_i[2], exp_i[3]);
                    fprintf(stderr, "  Found %d, %d, %d, %d\n",
                         pix[0], pix[1], pix[2], pix[3]);
+		   pass = false;
+		   break;
                }
           }
       }
@@ -256,7 +261,7 @@ test_fbo(const struct format_info *info)
    glDeleteTextures(1, &texObj);
    glDeleteFramebuffers(1, &fbo);
 
-   return GL_TRUE;
+   return pass;
 }
 
 
@@ -265,7 +270,7 @@ piglit_display(void)
 {
    int f;
    for (f = 0; f < NUM_FORMATS; f++) {
-      GLboolean pass = test_fbo(&Formats[f]);
+      bool pass = test_fbo(&Formats[f]);
       if (!pass)
          return PIGLIT_FAIL;
    }
-- 
1.7.7



More information about the Piglit mailing list