]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: TEST_FAIL() support for os_get_random()
authorJouni Malinen <j@w1.fi>
Sat, 7 Jan 2017 20:15:41 +0000 (22:15 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 7 Jan 2017 20:15:41 +0000 (22:15 +0200)
This allows more testing for rarely executed error paths.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/utils/os_unix.c

index 65c6fa412f207f7458338a5746d0a337316caffe..26fd172b78ba2c1709a112abd23ce71f8ab2e135 100644 (file)
@@ -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) {