From 729651260db2a2ec0fafe06586c570febe69e60d Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Thu, 7 Feb 2013 17:06:49 -0800 Subject: [PATCH] a program to print out the error strings for winsock errors --- test/Makefile.nmake | 9 ++++-- test/print-winsock-errors.c | 61 +++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 test/print-winsock-errors.c diff --git a/test/Makefile.nmake b/test/Makefile.nmake index 09b9e879..f4372b5c 100644 --- a/test/Makefile.nmake +++ b/test/Makefile.nmake @@ -24,11 +24,13 @@ REGRESS_OBJS=regress.obj regress_buffer.obj regress_http.obj regress_dns.obj \ OTHER_OBJS=test-init.obj test-eof.obj test-weof.obj test-time.obj \ bench.obj bench_cascade.obj bench_http.obj bench_httpclient.obj \ - test-changelist.obj + test-changelist.obj \ + print-winsock-errors.obj PROGRAMS=regress.exe \ test-init.exe test-eof.exe test-weof.exe test-time.exe \ - test-changelist.exe + test-changelist.exe \ + print-winsock-errors.exe # Disabled for now: # bench.exe bench_cascade.exe bench_http.exe bench_httpclient.exe @@ -52,6 +54,9 @@ test-weof.exe: test-weof.obj test-time.exe: test-time.obj $(CC) $(CFLAGS) $(LIBS) test-time.obj +print-winsock-errors.exe: print-winsock-errors.obj + $(CC) $(CFLAGS) $(LIBS) print-winsock-errors.obj + bench.exe: bench.obj $(CC) $(CFLAGS) $(LIBS) bench.obj bench_cascade.exe: bench_cascade.obj diff --git a/test/print-winsock-errors.c b/test/print-winsock-errors.c new file mode 100644 index 00000000..5064d0ba --- /dev/null +++ b/test/print-winsock-errors.c @@ -0,0 +1,61 @@ +#include +#include + +#include +#include + +#include "event2/util.h" +#include "event2/thread.h" + +#define E(x) printf (#x " -> \"%s\"\n", evutil_socket_error_to_string (x)); + +int main (int argc, char **argv) +{ + evthread_use_windows_threads (); + + E(WSAEINTR); + E(WSAEACCES); + E(WSAEFAULT); + E(WSAEINVAL); + E(WSAEMFILE); + E(WSAEWOULDBLOCK); + E(WSAEINPROGRESS); + E(WSAEALREADY); + E(WSAENOTSOCK); + E(WSAEDESTADDRREQ); + E(WSAEMSGSIZE); + E(WSAEPROTOTYPE); + E(WSAENOPROTOOPT); + E(WSAEPROTONOSUPPORT); + E(WSAESOCKTNOSUPPORT); + E(WSAEOPNOTSUPP); + E(WSAEPFNOSUPPORT); + E(WSAEAFNOSUPPORT); + E(WSAEADDRINUSE); + E(WSAEADDRNOTAVAIL); + E(WSAENETDOWN); + E(WSAENETUNREACH); + E(WSAENETRESET); + E(WSAECONNABORTED); + E(WSAECONNRESET); + E(WSAENOBUFS); + E(WSAEISCONN); + E(WSAENOTCONN); + E(WSAESHUTDOWN); + E(WSAETIMEDOUT); + E(WSAECONNREFUSED); + E(WSAEHOSTDOWN); + E(WSAEHOSTUNREACH); + E(WSAEPROCLIM); + E(WSASYSNOTREADY); + E(WSAVERNOTSUPPORTED); + E(WSANOTINITIALISED); + E(WSAEDISCON); + E(WSATYPE_NOT_FOUND); + E(WSAHOST_NOT_FOUND); + E(WSATRY_AGAIN); + E(WSANO_RECOVERY); + E(WSANO_DATA); + + return EXIT_SUCCESS; +} -- 2.40.0