diff mbox

[PATCHv4,5/5] validation: odp_timer.c: remove usage of perror/abort

Message ID 1422545560-6466-6-git-send-email-ola.liljedahl@linaro.org
State Superseded
Headers show

Commit Message

Ola Liljedahl Jan. 29, 2015, 3:32 p.m. UTC
Replace usage of perror and abort with CU_FAIL_FATAL in order for fatal
errors not to disturb the overall validation flow.

Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
---
(This document/code contribution attached is provided under the terms of
agreement LES-LTM-21309)

 test/validation/odp_timer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
index d78f6b6..1f673c0 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -11,7 +11,6 @@ 
 /* For rand_r and nanosleep */
 #define _POSIX_C_SOURCE 200112L
 #include <time.h>
-#include <unistd.h>
 #include <odp.h>
 #include "odp_cunit_common.h"
 #include "test_debug.h"
@@ -124,7 +123,7 @@  static void *worker_entrypoint(void *arg)
 
 	struct test_timer *tt = malloc(sizeof(struct test_timer) * NTIMERS);
 	if (tt == NULL)
-		perror("malloc"), abort();
+		CU_FAIL_FATAL("malloc failed");
 
 	/* Prepare all timers */
 	for (i = 0; i < NTIMERS; i++) {
@@ -215,7 +214,7 @@  static void *worker_entrypoint(void *arg)
 		ts.tv_sec = 0;
 		ts.tv_nsec = 1000000; /* 1ms */
 		if (nanosleep(&ts, NULL) < 0)
-			perror("nanosleep"), abort();
+			CU_FAIL_FATAL("nanosleep failed");
 	}
 
 	/* Cancel and free all timers */
@@ -246,7 +245,7 @@  static void *worker_entrypoint(void *arg)
 	ts.tv_sec = 0;
 	ts.tv_nsec = 1000000; /* 1ms */
 	if (nanosleep(&ts, NULL) < 0)
-		perror("nanosleep"), abort();
+		CU_FAIL_FATAL("nanosleep failed");
 	while (nstale != 0) {
 		odp_event_t ev = odp_queue_deq(queue);
 		if (ev != ODP_EVENT_INVALID) {