diff mbox

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

Message ID 1427995268-20530-2-git-send-email-stuart.haslam@linaro.org
State Accepted
Commit 1189f9917c9d0f1b6bf99a75a2c08903e4fcccba
Headers show

Commit Message

Stuart Haslam April 2, 2015, 5:21 p.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(-)
diff mbox

Patch

diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c
index 7359ce3..2af4410 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -83,8 +83,15 @@  int main(void)
 	if (0 != tests_global_term())
 		return -1;
 
-	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;
 }