diff mbox

validation: common: prevent masking test failures

Message ID 1425557403-11622-1-git-send-email-stuart.haslam@linaro.org
State Accepted
Commit 301e45bb1faef9b0a306bc5c23f92371b1d3add9
Headers show

Commit Message

Stuart Haslam March 5, 2015, 12:10 p.m. UTC
The addition of tests_global_term() inadvertently masked test failures
by overwritting the value of ret.

Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
---
Coverity flagged this with CID 87973

 test/validation/common/odp_cunit_common.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Bill Fischofer March 5, 2015, 1:27 p.m. UTC | #1
On Thu, Mar 5, 2015 at 6:10 AM, Stuart Haslam <stuart.haslam@linaro.org>
wrote:

> The addition of tests_global_term() inadvertently masked test failures
> by overwritting the value of ret.
>
> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
> Coverity flagged this with CID 87973
>
>  test/validation/common/odp_cunit_common.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/test/validation/common/odp_cunit_common.c
> b/test/validation/common/odp_cunit_common.c
> index 655d157..83e5026 100644
> --- a/test/validation/common/odp_cunit_common.c
> +++ b/test/validation/common/odp_cunit_common.c
> @@ -80,9 +80,8 @@ int main(void)
>
>         CU_cleanup_registry();
>
> -       ret = tests_global_term();
> -       if (ret)
> -               return ret;
> +       if (0 != tests_global_term())
> +               return -1;
>
>         odp_term_local();
>         odp_term_global();
> --
> 2.1.1
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov March 6, 2015, 10:44 a.m. UTC | #2
Merged,
Maxim.

On 03/05/15 16:27, Bill Fischofer wrote:
>
>
> On Thu, Mar 5, 2015 at 6:10 AM, Stuart Haslam 
> <stuart.haslam@linaro.org <mailto:stuart.haslam@linaro.org>> wrote:
>
>     The addition of tests_global_term() inadvertently masked test failures
>     by overwritting the value of ret.
>
>     Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org
>     <mailto:stuart.haslam@linaro.org>>
>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
>     ---
>     Coverity flagged this with CID 87973
>
>      test/validation/common/odp_cunit_common.c | 5 ++---
>      1 file changed, 2 insertions(+), 3 deletions(-)
>
>     diff --git a/test/validation/common/odp_cunit_common.c
>     b/test/validation/common/odp_cunit_common.c
>     index 655d157..83e5026 100644
>     --- a/test/validation/common/odp_cunit_common.c
>     +++ b/test/validation/common/odp_cunit_common.c
>     @@ -80,9 +80,8 @@ int main(void)
>
>             CU_cleanup_registry();
>
>     -       ret = tests_global_term();
>     -       if (ret)
>     -               return ret;
>     +       if (0 != tests_global_term())
>     +               return -1;
>
>             odp_term_local();
>             odp_term_global();
>     --
>     2.1.1
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c
index 655d157..83e5026 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -80,9 +80,8 @@  int main(void)
 
 	CU_cleanup_registry();
 
-	ret = tests_global_term();
-	if (ret)
-		return ret;
+	if (0 != tests_global_term())
+		return -1;
 
 	odp_term_local();
 	odp_term_global();