From: Jouni Malinen Date: Sat, 7 Jan 2017 20:15:41 +0000 (+0200) Subject: tests: TEST_FAIL() support for os_get_random() X-Git-Tag: hostap_2_7~1802 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5de6823f7a62dd3547c5ac949fcf9e063e56885d;p=thirdparty%2Fhostap.git tests: TEST_FAIL() support for os_get_random() This allows more testing for rarely executed error paths. Signed-off-by: Jouni Malinen --- 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) {