[Piglit] [PATCH] arb_get_program_binary/retrievable_hint: fix typo

Haixia Shi hshi at chromium.org
Thu Apr 14 20:29:36 UTC 2016


Although my patch is incorrect, the code here is not right either.

See piglit-util-gl.h:

113 /**
114  * \brief Check for unexpected GL errors.
115  *
116  * If glGetError() returns an error other than \c expected_error, then
117  * print a diagnostic and return GL_FALSE.  Otherwise return GL_TRUE.
118  */
119 GLboolean
120 piglit_check_gl_error_(GLenum expected_error, const char *file,
unsigned line);

This function returns GL_FALSE in case of an error, and GL_TRUE in case of
no errors.

Therefore it should be

got_error = !piglit_check_gl_error(0);


On Thu, Apr 14, 2016 at 1:17 PM, Haixia Shi <hshi at chromium.org> wrote:

> Hi Dylan
>
> Sorry about that. You're correct and I did misread this "if" statement.
>
> Please consider this patch abandoned.
>
> On Thu, Apr 14, 2016 at 11:56 AM, Dylan Baker <baker.dylan.c at gmail.com>
> wrote:
>
>> Quoting Haixia Shi (2016-04-14 11:11:25)
>> > The variable "pass" is incorrectly set to false unconditionally. This
>> > prevents the test from ever passing.
>> >
>> > Signed-off-by: Haixia Shi <hshi at chromium.org>
>> > ---
>> >  tests/spec/arb_get_program_binary/retrievable_hint.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/tests/spec/arb_get_program_binary/retrievable_hint.c
>> b/tests/spec/arb_get_program_binary/retrievable_hint.c
>> > index 8283c5b..4b9264c 100644
>> > --- a/tests/spec/arb_get_program_binary/retrievable_hint.c
>> > +++ b/tests/spec/arb_get_program_binary/retrievable_hint.c
>> > @@ -97,7 +97,7 @@ piglit_init(int argc, char **argv)
>> >                         pass = false;
>> >                 }
>> >         } else
>> > -               pass = false;
>> > +               pass = true;
>> >
>> >         /* The ARB_get_program_binary spec says:
>> >          *
>> > --
>> > 2.8.0.rc3.226.g39d4020
>> >
>> > _______________________________________________
>> > Piglit mailing list
>> > Piglit at lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/piglit
>>
>> Hi,
>>
>> I don't think this patch is correct. The context doesn't show it, but
>> this else case is the else of '!got_error', which means pass is set to
>> false when there is an error.
>>
>> I've CC'd Ian (who wrote the test). Maybe he knows better.
>>
>> Dylan
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160414/64ec5fff/attachment.html>


More information about the Piglit mailing list