arb_es2_compatibility: Check piglit_link_check_status result.

Submitted by Vinson Lee on Dec. 1, 2015, 5:37 a.m.

Details

Message ID 1448948257-8658-1-git-send-email-vlee@freedesktop.org
State New
Headers show
Series "arb_es2_compatibility: Check piglit_link_check_status result." ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Vinson Lee Dec. 1, 2015, 5:37 a.m.
Fixes Coverity "unchecked return value" defect.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 .../arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
index b5c476e..ae5830d 100644
--- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
+++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
@@ -70,7 +70,7 @@  draw(const float *color, float x_offset)
 
 	glBindAttribLocation(prog, 0, "vertex");
 	glLinkProgram(prog);
-	piglit_link_check_status(prog);
+	assert(piglit_link_check_status(prog));
 
 	glUseProgram(prog);
 	color_location = glGetUniformLocation(prog, "color");

Comments

On 11/30/2015 10:37 PM, Vinson Lee wrote:
> Fixes Coverity "unchecked return value" defect.
>
> Signed-off-by: Vinson Lee <vlee@freedesktop.org>
> ---
>   .../arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
> index b5c476e..ae5830d 100644
> --- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
> +++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
> @@ -70,7 +70,7 @@ draw(const float *color, float x_offset)
>
>   	glBindAttribLocation(prog, 0, "vertex");
>   	glLinkProgram(prog);
> -	piglit_link_check_status(prog);
> +	assert(piglit_link_check_status(prog));

I'd probably do:

(void) piglit_link_check_status(prog);

so the call is made even in non-debug builds.

-Brian

>
>   	glUseProgram(prog);
>   	color_location = glGetUniformLocation(prog, "color");
>
On Tue, Dec 1, 2015 at 7:20 AM, Brian Paul <brianp@vmware.com> wrote:
> On 11/30/2015 10:37 PM, Vinson Lee wrote:
>>
>> Fixes Coverity "unchecked return value" defect.
>>
>> Signed-off-by: Vinson Lee <vlee@freedesktop.org>
>> ---
>>   .../arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
>> | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git
>> a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
>> b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
>> index b5c476e..ae5830d 100644
>> ---
>> a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
>> +++
>> b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
>> @@ -70,7 +70,7 @@ draw(const float *color, float x_offset)
>>
>>         glBindAttribLocation(prog, 0, "vertex");
>>         glLinkProgram(prog);
>> -       piglit_link_check_status(prog);
>> +       assert(piglit_link_check_status(prog));
>
>
> I'd probably do:
>
> (void) piglit_link_check_status(prog);
>
> so the call is made even in non-debug builds.
>
> -Brian
>
>

piglit_link_check_status doesn't fail the test on a link failure if we
do not use the result. Wouldn't this call be a no-op for both debug
and non-debug builds?

>>
>>         glUseProgram(prog);
>>         color_location = glGetUniformLocation(prog, "color");
>>
>