Parcourir la 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 il y a 8 ans
Parent
commit
5de6823f7a
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  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) {