[Piglit] [PATCH] getteximage-formats: Ensure pass is initialized.

Brian Paul brian.e.paul at gmail.com
Wed Dec 12 06:50:26 PST 2012


On Tue, Dec 11, 2012 at 11:51 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> Fixes uninitialized scalar variable defect reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  tests/texturing/getteximage-formats.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/texturing/getteximage-formats.c b/tests/texturing/getteximage-formats.c
> index 0e12338..0aec3ae 100644
> --- a/tests/texturing/getteximage-formats.c
> +++ b/tests/texturing/getteximage-formats.c
> @@ -472,6 +472,7 @@ piglit_display(void)
>                         pass = test_format(set, &set->format[format_index]);
>                 }
>                 else {
> +                       pass = GL_FALSE;
>                         glClear(GL_COLOR_BUFFER_BIT);
>                         piglit_present_results();
>                 }

Actually, I think we want to set pass=GL_TRUE here since we don't want
to generate PIGLIT_FAIL when the format/extension isn't supported.

So:

@@ -472,6 +472,8 @@ piglit_display(void)
                        pass = test_format(set, &set->format[format_index]);
                }
                else {
+                       /* unsupported format - not a failure */
+                       pass = GL_TRUE;
                        glClear(GL_COLOR_BUFFER_BIT);
                        piglit_present_results();
                }


-Brian


More information about the Piglit mailing list