summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Sampson <ats@offog.org>2013-07-17 13:44:03 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-07-17 21:39:02 +0200
commit260f8de38d622af49d8077996ccc61f640eaebe8 (patch)
treec1cd7c1fb006f83a9b1db11aec2d8869d1a44187
parent147b72a1c1fc74f871194ac24a6b8635d4289849 (diff)
downloadgnutls-260f8de38d622af49d8077996ccc61f640eaebe8.tar.gz
Disable tests that use socketpair on _WIN32.
socketpair isn't provided on Windows, so these tests should just exit 77. Note that resume-dtls.c already had a guard like this -- I've rewritten it to match the others, but socketpair (presumably!) isn't the only reason that test is disabled on Win32. Signed-off-by: Adam Sampson <ats@offog.org>
-rw-r--r--tests/anonself.c14
-rw-r--r--tests/dhepskself.c14
-rw-r--r--tests/openpgpself.c14
-rw-r--r--tests/pskself.c14
-rw-r--r--tests/resume-dtls.c22
-rw-r--r--tests/resume.c14
-rw-r--r--tests/x509dn.c14
-rw-r--r--tests/x509self.c14
8 files changed, 110 insertions, 10 deletions
diff --git a/tests/anonself.c b/tests/anonself.c
index c76e8ba3f9..843647164e 100644
--- a/tests/anonself.c
+++ b/tests/anonself.c
@@ -29,6 +29,18 @@
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(_WIN32)
+
+/* socketpair isn't supported on Win32. */
+int
+main (int argc, char** argv)
+{
+ exit (77);
+}
+
+#else
+
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
@@ -305,3 +317,5 @@ doit (void)
else
client (sockets[1]);
}
+
+#endif /* _WIN32 */
diff --git a/tests/dhepskself.c b/tests/dhepskself.c
index 854a711ef1..ef7373bae2 100644
--- a/tests/dhepskself.c
+++ b/tests/dhepskself.c
@@ -29,6 +29,18 @@
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(_WIN32)
+
+/* socketpair isn't supported on Win32. */
+int
+main (int argc, char** argv)
+{
+ exit (77);
+}
+
+#else
+
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -302,3 +314,5 @@ doit (void)
else
client (sockets[1]);
}
+
+#endif /* _WIN32 */
diff --git a/tests/openpgpself.c b/tests/openpgpself.c
index 9c2111778b..80b016d853 100644
--- a/tests/openpgpself.c
+++ b/tests/openpgpself.c
@@ -29,6 +29,18 @@
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(_WIN32)
+
+/* socketpair isn't supported on Win32. */
+int
+main (int argc, char** argv)
+{
+ exit (77);
+}
+
+#else
+
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -624,3 +636,5 @@ doit (void)
else
client (client_sds);
}
+
+#endif /* _WIN32 */
diff --git a/tests/pskself.c b/tests/pskself.c
index 96ad9653a8..ed5229dba4 100644
--- a/tests/pskself.c
+++ b/tests/pskself.c
@@ -29,6 +29,18 @@
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(_WIN32)
+
+/* socketpair isn't supported on Win32. */
+int
+main (int argc, char** argv)
+{
+ exit (77);
+}
+
+#else
+
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -289,3 +301,5 @@ doit (void)
else
client (sockets[1]);
}
+
+#endif /* _WIN32 */
diff --git a/tests/resume-dtls.c b/tests/resume-dtls.c
index aa28b747f0..65cf3c2ea5 100644
--- a/tests/resume-dtls.c
+++ b/tests/resume-dtls.c
@@ -29,6 +29,17 @@
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(_WIN32)
+
+int
+main (int argc, char** argv)
+{
+ exit (77);
+}
+
+#else
+
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -38,15 +49,6 @@
#include <unistd.h>
#include <gnutls/gnutls.h>
-#if defined(_WIN32)
-
-int main()
-{
- exit(77);
-}
-
-#else
-
#include "utils.h"
static void wrap_db_init (void);
@@ -626,4 +628,4 @@ wrap_db_delete (void *dbf, gnutls_datum_t key)
}
-#endif /* WIN32 */
+#endif /* _WIN32 */
diff --git a/tests/resume.c b/tests/resume.c
index b0d137b22c..6156007ef9 100644
--- a/tests/resume.c
+++ b/tests/resume.c
@@ -29,6 +29,18 @@
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(_WIN32)
+
+/* socketpair isn't supported on Win32. */
+int
+main (int argc, char** argv)
+{
+ exit (77);
+}
+
+#else
+
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -612,3 +624,5 @@ wrap_db_delete (void *dbf, gnutls_datum_t key)
return -1;
}
+
+#endif /* _WIN32 */
diff --git a/tests/x509dn.c b/tests/x509dn.c
index af410838b3..1ecc51941e 100644
--- a/tests/x509dn.c
+++ b/tests/x509dn.c
@@ -29,6 +29,18 @@
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(_WIN32)
+
+/* socketpair isn't supported on Win32. */
+int
+main (int argc, char** argv)
+{
+ exit (77);
+}
+
+#else
+
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -507,3 +519,5 @@ doit (void)
else
client (sockets[1]);
}
+
+#endif /* _WIN32 */
diff --git a/tests/x509self.c b/tests/x509self.c
index e0b55f0b8f..e52c0558c2 100644
--- a/tests/x509self.c
+++ b/tests/x509self.c
@@ -29,6 +29,18 @@
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(_WIN32)
+
+/* socketpair isn't supported on Win32. */
+int
+main (int argc, char** argv)
+{
+ exit (77);
+}
+
+#else
+
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -477,3 +489,5 @@ doit (void)
else
client (sockets[1]);
}
+
+#endif /* _WIN32 */