arb_internalformat_query2: Set expected_value in default case.

Submitted by Vinson Lee on March 8, 2016, 1:02 a.m.

Details

Message ID 1457398944-4925-1-git-send-email-vlee@freedesktop.org
State New
Headers show
Series "arb_internalformat_query2: Set expected_value in default case." ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Vinson Lee March 8, 2016, 1:02 a.m.
Fixes uninitialized scalar defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 tests/spec/arb_internalformat_query2/format-components.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_internalformat_query2/format-components.c b/tests/spec/arb_internalformat_query2/format-components.c
index 10d7f5258108..4e89a7b7b152 100644
--- a/tests/spec/arb_internalformat_query2/format-components.c
+++ b/tests/spec/arb_internalformat_query2/format-components.c
@@ -218,6 +218,7 @@  try(const GLenum *targets, unsigned num_targets,
                                         break;
                                 default:
                                         assert("incorrect pname for test");
+                                        expected_value = 0;
                                         break;
                                 }
 

Comments

On 03/07/2016 06:02 PM, Vinson Lee wrote:
> Fixes uninitialized scalar defect reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee@freedesktop.org>
> ---
>   tests/spec/arb_internalformat_query2/format-components.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/tests/spec/arb_internalformat_query2/format-components.c b/tests/spec/arb_internalformat_query2/format-components.c
> index 10d7f5258108..4e89a7b7b152 100644
> --- a/tests/spec/arb_internalformat_query2/format-components.c
> +++ b/tests/spec/arb_internalformat_query2/format-components.c
> @@ -218,6 +218,7 @@ try(const GLenum *targets, unsigned num_targets,
>                                           break;
>                                   default:
>                                           assert("incorrect pname for test");

That assertion can't be right.  The intention was probably !"incorrect 
pname for test"

Maybe you can fix that too.

-Brian


> +                                        expected_value = 0;
>                                           break;
>                                   }
>
>