[Piglit] [PATCH v3] arb_internalformat_query2: Initialize expected_value.

Vinson Lee vlee at freedesktop.org
Wed Mar 9 02:57:46 UTC 2016


It was uninitialized in the default case in release builds.

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>
Reviewed-by: Alejandro PiƱeiro <apinheiro at igalia.com>
---
 tests/spec/arb_internalformat_query2/format-components.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_internalformat_query2/format-components.c b/tests/spec/arb_internalformat_query2/format-components.c
index 10d7f5258108..bcd1c78cf53f 100644
--- a/tests/spec/arb_internalformat_query2/format-components.c
+++ b/tests/spec/arb_internalformat_query2/format-components.c
@@ -204,7 +204,7 @@ try(const GLenum *targets, unsigned num_targets,
                                 value_test = test_data_is_unsupported_response(data, pname);
                         } else {
                                 GLint returned_value = test_data_value_at_index(data, 0);
-                                GLint expected_value;
+                                GLint expected_value = -1;
 
                                 switch(pname) {
                                 case GL_COLOR_COMPONENTS:
@@ -217,7 +217,7 @@ 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");
                                         break;
                                 }
 
-- 
2.5.0



More information about the Piglit mailing list