[Piglit] [PATCH v2] arb_internalformat_query2: Set expected_value in default case.
Alejandro Piñeiro
apinheiro at igalia.com
Tue Mar 8 08:03:36 UTC 2016
On 08/03/16 07:37, Vinson Lee wrote:
> Fixes uninitialized scalar defect reported by Coverity.
>
> Also fix incorrect assertion.
>
> Suggested-by: Brian Paul <brianp at vmware.com>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> tests/spec/arb_internalformat_query2/format-components.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/spec/arb_internalformat_query2/format-components.c b/tests/spec/arb_internalformat_query2/format-components.c
> index 10d7f52..3b8cf35 100644
> --- a/tests/spec/arb_internalformat_query2/format-components.c
> +++ b/tests/spec/arb_internalformat_query2/format-components.c
> @@ -217,7 +217,8 @@ try(const GLenum *targets, unsigned num_targets,
> expected_value = is_depth_format(internalformats[j]);
> break;
> default:
> - assert("incorrect pname for test");
> + assert(!"incorrect pname for test");
> + expected_value = 0;
> break;
> }
>
I would prefer a value that is clearly wrong, like -1 and initialize the
variable to -1 instead of adding a fake assignment on default.
Additionally, both things is what it is done on image-texture test, so
it is probably more consistent this way.
With those small changes:
Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Thanks.
More information about the Piglit
mailing list