[Piglit] [PATCH] glean/pointsprite: Don't abort when there are no non-black pixels
Brian Paul
brianp at vmware.com
Thu Aug 8 06:46:46 PDT 2013
On 08/07/2013 06:52 PM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Instead, just fail the test.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64262
> Cc: Hua Lu <huax.lu at intel.com>
> ---
> Hua,
>
> Can you verify that this fixes the 'abort' in piglit runs on Pineview?
> The test should just fail instead.
>
> tests/glean/tpointsprite.cpp | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/tests/glean/tpointsprite.cpp b/tests/glean/tpointsprite.cpp
> index 7a29d3a..155b416 100644
> --- a/tests/glean/tpointsprite.cpp
> +++ b/tests/glean/tpointsprite.cpp
> @@ -250,7 +250,7 @@ PointSpriteTest::CompareColor(GLfloat *actual, GLfloat *expected)
> }
>
>
> -static void
> +static bool
> FindNonBlack(const GLfloat *buf, GLint w, GLint h, GLint *x0, GLint *y0)
> {
> GLint i, j;
> @@ -262,11 +262,12 @@ FindNonBlack(const GLfloat *buf, GLint w, GLint h, GLint *x0, GLint *y0)
> buf[k+2] != bgColor[2]) {
> *x0 = j;
> *y0 = i;
> - return;
> + return true;
> }
> }
> }
> - abort();
> +
> + return false;
> }
>
>
> @@ -289,7 +290,11 @@ PointSpriteTest::ComparePixels(GLfloat *buf, int pSize, GLenum coordOrigin)
> // Find first (lower-left) pixel that's not black.
> // The pixels hit by sprite rasterization may vary from one GL to
> // another so try to compensate for that.
> - FindNonBlack(buf, WINSIZE/2, WINSIZE/2, &x0, &y0);
> + if (!FindNonBlack(buf, WINSIZE/2, WINSIZE/2, &x0, &y0))
> + {
> + env->log << "Could not find any non-black pixels.\n";
> + return GL_FALSE;
> + }
>
> for (i = 0; i < WINSIZE / 2; i++)
> {
>
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the Piglit
mailing list