diff mbox

[2/2] validation: common: catch odp_term_local/global failures

Message ID 1424779071-22631-2-git-send-email-stuart.haslam@linaro.org
State New
Headers show

Commit Message

Stuart Haslam Feb. 24, 2015, 11:57 a.m. UTC
Failures in odp_term_local() or odp_term_global() are an indication
that the test did not correctly clean up after itself so should cause
the test to fail.

Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
---
 test/validation/common/odp_cunit_common.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Maxim Uvarov March 10, 2015, 11:13 a.m. UTC | #1
Only odp_schedule left to merge this patch.

Maxim.

On 02/24/15 14:57, Stuart Haslam wrote:
> Failures in odp_term_local() or odp_term_global() are an indication
> that the test did not correctly clean up after itself so should cause
> the test to fail.
>
> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
> ---
>   test/validation/common/odp_cunit_common.c | 11 +++++++++--
>   1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c
> index b8d3313..b23af26 100644
> --- a/test/validation/common/odp_cunit_common.c
> +++ b/test/validation/common/odp_cunit_common.c
> @@ -75,8 +75,15 @@ int main(void)
>   
>   	CU_cleanup_registry();
>   
> -	odp_term_local();
> -	odp_term_global();
> +	if (0 != odp_term_local()) {
> +		fprintf(stderr, "error: odp_term_local() failed.\n");
> +		return -1;
> +	}
> +
> +	if (0 != odp_term_global()) {
> +		fprintf(stderr, "error: odp_term_global() failed.\n");
> +		return -1;
> +	}
>   
>   	return (ret) ? -1 : 0;
>   }
Stuart Haslam April 2, 2015, 5:13 p.m. UTC | #2
On Tue, Mar 10, 2015 at 02:13:18PM +0300, Maxim Uvarov wrote:
> Only odp_schedule left to merge this patch.
> 
> Maxim.
> 

This could go in now as all the term failures have been fixed, but it no
longer applies, so I'll rebase and send a v2.

--
Stuart.

> On 02/24/15 14:57, Stuart Haslam wrote:
> >Failures in odp_term_local() or odp_term_global() are an indication
> >that the test did not correctly clean up after itself so should cause
> >the test to fail.
> >
> >Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
> >---
> >  test/validation/common/odp_cunit_common.c | 11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> >
> >diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c
> >index b8d3313..b23af26 100644
> >--- a/test/validation/common/odp_cunit_common.c
> >+++ b/test/validation/common/odp_cunit_common.c
> >@@ -75,8 +75,15 @@ int main(void)
> >  	CU_cleanup_registry();
> >-	odp_term_local();
> >-	odp_term_global();
> >+	if (0 != odp_term_local()) {
> >+		fprintf(stderr, "error: odp_term_local() failed.\n");
> >+		return -1;
> >+	}
> >+
> >+	if (0 != odp_term_global()) {
> >+		fprintf(stderr, "error: odp_term_global() failed.\n");
> >+		return -1;
> >+	}
> >  	return (ret) ? -1 : 0;
> >  }
> 
>
diff mbox

Patch

diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c
index b8d3313..b23af26 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -75,8 +75,15 @@  int main(void)
 
 	CU_cleanup_registry();
 
-	odp_term_local();
-	odp_term_global();
+	if (0 != odp_term_local()) {
+		fprintf(stderr, "error: odp_term_local() failed.\n");
+		return -1;
+	}
+
+	if (0 != odp_term_global()) {
+		fprintf(stderr, "error: odp_term_global() failed.\n");
+		return -1;
+	}
 
 	return (ret) ? -1 : 0;
 }