diff mbox

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

Message ID 1423124161-18716-6-git-send-email-ola.liljedahl@linaro.org
State Accepted
Commit a44d80bca7e8cd133746fa26d0399ada3519fdc9
Headers show

Commit Message

Ola Liljedahl Feb. 5, 2015, 8:16 a.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 5c997ee..5218406 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) {