From 5de6823f7a62dd3547c5ac949fcf9e063e56885d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 7 Jan 2017 22:15:41 +0200 Subject: [PATCH] tests: TEST_FAIL() support for os_get_random() This allows more testing for rarely executed error paths. Signed-off-by: Jouni Malinen --- src/utils/os_unix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index 65c6fa412..26fd172b7 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -80,6 +80,9 @@ int os_get_reltime(struct os_reltime *t) struct timespec ts; int res; + if (TEST_FAIL()) + return -1; + while (1) { res = clock_gettime(clock_id, &ts); if (res == 0) {