Browse Source

tests: TEST_FAIL() support for os_get_random()

This allows more testing for rarely executed error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 8 years ago
parent
commit
5de6823f7a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/utils/os_unix.c

+ 3 - 0
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) {