Skip to contentSkip to conversation

Remove unistd.h from unit test

PATCH In review Arne Schwabe 2 participants 2 messages Aug 2, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Remove unistd.h from unit test

the unit tests do not compile under Windows since Windows does not provide a unistd.h header. The header is still included on Unix platforms via syshead.h

---
 tests/unit_tests/openvpn/test_argv.c       | 1 -
 tests/unit_tests/openvpn/test_auth_token.c | 1 -
 tests/unit_tests/openvpn/test_crypto.c     | 1 -
 tests/unit_tests/openvpn/test_misc.c       | 1 -
 tests/unit_tests/openvpn/test_ncp.c        | 1 -
 tests/unit_tests/openvpn/test_tls_crypt.c  | 1 -
 6 files changed, 6 deletions(-)
tests/unit_tests/openvpn/test_argv.c +0 -1
index 3dc470a52..e686adcb5 100644
@@ -2,7 +2,6 @@
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
tests/unit_tests/openvpn/test_auth_token.c +0 -1
index 6bfad6efb..5299c3643 100644
@@ -30,7 +30,6 @@
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
tests/unit_tests/openvpn/test_crypto.c +0 -1
index f4cc81a04..32063fc46 100644
@@ -30,7 +30,6 @@
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
tests/unit_tests/openvpn/test_misc.c +0 -1
index b7623bea0..70f726d0f 100644
@@ -30,7 +30,6 @@
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
tests/unit_tests/openvpn/test_ncp.c +0 -1
index 293093f1a..613b5f1ba 100644
@@ -30,7 +30,6 @@
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
tests/unit_tests/openvpn/test_tls_crypt.c +0 -1
index 3e604d672..12ea9452d 100644
@@ -30,7 +30,6 @@
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
Signature · 1 line
2.32.0
Acked-by on v2 1/1
#1 lore raw

That was an easy one for a change :-)

We should make our mind on all the other includes, though - like <stdio.h>, <stdlib.h>, <stdarg.h> - they come via "syshead.h" as well today, and are included another time in all the test_*.c files.

Did not do windows compilation, but tested Linux and FreeBSD, and (unsurprisingly) no change wrt the unit tests.

Your patch has been applied to the master branch.

commit f9dbf645fa5b6fdda06abebedbed772a83d8f0d9

Author: Arne Schwabe
Date:   Mon Aug 2 12:07:40 2021 +0200
     Remove unistd.h from unit test

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg22685.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering