[Openvpn-devel,v2] Remove unistd.h from unit test

Message ID 20210802100740.694474-1-arne@rfc2549.org
State Accepted
Headers show
Series [Openvpn-devel,v2] Remove unistd.h from unit test | expand

Commit Message

Arne Schwabe Aug. 2, 2021, 12:07 a.m. UTC
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

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 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(-)

Comments

Gert Doering Aug. 2, 2021, 12:39 a.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

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 <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20210802100740.694474-1-arne@rfc2549.org>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22685.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/tests/unit_tests/openvpn/test_argv.c b/tests/unit_tests/openvpn/test_argv.c
index 3dc470a52..e686adcb5 100644
--- a/tests/unit_tests/openvpn/test_argv.c
+++ b/tests/unit_tests/openvpn/test_argv.c
@@ -2,7 +2,6 @@ 
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
diff --git a/tests/unit_tests/openvpn/test_auth_token.c b/tests/unit_tests/openvpn/test_auth_token.c
index 6bfad6efb..5299c3643 100644
--- a/tests/unit_tests/openvpn/test_auth_token.c
+++ b/tests/unit_tests/openvpn/test_auth_token.c
@@ -30,7 +30,6 @@ 
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
diff --git a/tests/unit_tests/openvpn/test_crypto.c b/tests/unit_tests/openvpn/test_crypto.c
index f4cc81a04..32063fc46 100644
--- a/tests/unit_tests/openvpn/test_crypto.c
+++ b/tests/unit_tests/openvpn/test_crypto.c
@@ -30,7 +30,6 @@ 
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
diff --git a/tests/unit_tests/openvpn/test_misc.c b/tests/unit_tests/openvpn/test_misc.c
index b7623bea0..70f726d0f 100644
--- a/tests/unit_tests/openvpn/test_misc.c
+++ b/tests/unit_tests/openvpn/test_misc.c
@@ -30,7 +30,6 @@ 
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
diff --git a/tests/unit_tests/openvpn/test_ncp.c b/tests/unit_tests/openvpn/test_ncp.c
index 293093f1a..613b5f1ba 100644
--- a/tests/unit_tests/openvpn/test_ncp.c
+++ b/tests/unit_tests/openvpn/test_ncp.c
@@ -30,7 +30,6 @@ 
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
diff --git a/tests/unit_tests/openvpn/test_tls_crypt.c b/tests/unit_tests/openvpn/test_tls_crypt.c
index 3e604d672..12ea9452d 100644
--- a/tests/unit_tests/openvpn/test_tls_crypt.c
+++ b/tests/unit_tests/openvpn/test_tls_crypt.c
@@ -30,7 +30,6 @@ 
 #include "syshead.h"
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>