mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-15 15:25:09 -04:00
make sure caching works, and we don't leak memory
This commit is contained in:
parent
0c6ec5d816
commit
2078e9b46a
@ -4,6 +4,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "event2/event.h"
|
||||||
#include "event2/util.h"
|
#include "event2/util.h"
|
||||||
#include "event2/thread.h"
|
#include "event2/thread.h"
|
||||||
|
|
||||||
@ -11,51 +12,65 @@
|
|||||||
|
|
||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
const char *s1, *s2;
|
||||||
|
|
||||||
evthread_use_windows_threads ();
|
evthread_use_windows_threads ();
|
||||||
|
|
||||||
E(WSAEINTR);
|
s1 = evutil_socket_error_to_string (WSAEINTR);
|
||||||
E(WSAEACCES);
|
|
||||||
E(WSAEFAULT);
|
for (i = 0; i < 3; i++) {
|
||||||
E(WSAEINVAL);
|
printf ("\niteration %d:\n\n", i);
|
||||||
E(WSAEMFILE);
|
E(WSAEINTR);
|
||||||
E(WSAEWOULDBLOCK);
|
E(WSAEACCES);
|
||||||
E(WSAEINPROGRESS);
|
E(WSAEFAULT);
|
||||||
E(WSAEALREADY);
|
E(WSAEINVAL);
|
||||||
E(WSAENOTSOCK);
|
E(WSAEMFILE);
|
||||||
E(WSAEDESTADDRREQ);
|
E(WSAEWOULDBLOCK);
|
||||||
E(WSAEMSGSIZE);
|
E(WSAEINPROGRESS);
|
||||||
E(WSAEPROTOTYPE);
|
E(WSAEALREADY);
|
||||||
E(WSAENOPROTOOPT);
|
E(WSAENOTSOCK);
|
||||||
E(WSAEPROTONOSUPPORT);
|
E(WSAEDESTADDRREQ);
|
||||||
E(WSAESOCKTNOSUPPORT);
|
E(WSAEMSGSIZE);
|
||||||
E(WSAEOPNOTSUPP);
|
E(WSAEPROTOTYPE);
|
||||||
E(WSAEPFNOSUPPORT);
|
E(WSAENOPROTOOPT);
|
||||||
E(WSAEAFNOSUPPORT);
|
E(WSAEPROTONOSUPPORT);
|
||||||
E(WSAEADDRINUSE);
|
E(WSAESOCKTNOSUPPORT);
|
||||||
E(WSAEADDRNOTAVAIL);
|
E(WSAEOPNOTSUPP);
|
||||||
E(WSAENETDOWN);
|
E(WSAEPFNOSUPPORT);
|
||||||
E(WSAENETUNREACH);
|
E(WSAEAFNOSUPPORT);
|
||||||
E(WSAENETRESET);
|
E(WSAEADDRINUSE);
|
||||||
E(WSAECONNABORTED);
|
E(WSAEADDRNOTAVAIL);
|
||||||
E(WSAECONNRESET);
|
E(WSAENETDOWN);
|
||||||
E(WSAENOBUFS);
|
E(WSAENETUNREACH);
|
||||||
E(WSAEISCONN);
|
E(WSAENETRESET);
|
||||||
E(WSAENOTCONN);
|
E(WSAECONNABORTED);
|
||||||
E(WSAESHUTDOWN);
|
E(WSAECONNRESET);
|
||||||
E(WSAETIMEDOUT);
|
E(WSAENOBUFS);
|
||||||
E(WSAECONNREFUSED);
|
E(WSAEISCONN);
|
||||||
E(WSAEHOSTDOWN);
|
E(WSAENOTCONN);
|
||||||
E(WSAEHOSTUNREACH);
|
E(WSAESHUTDOWN);
|
||||||
E(WSAEPROCLIM);
|
E(WSAETIMEDOUT);
|
||||||
E(WSASYSNOTREADY);
|
E(WSAECONNREFUSED);
|
||||||
E(WSAVERNOTSUPPORTED);
|
E(WSAEHOSTDOWN);
|
||||||
E(WSANOTINITIALISED);
|
E(WSAEHOSTUNREACH);
|
||||||
E(WSAEDISCON);
|
E(WSAEPROCLIM);
|
||||||
E(WSATYPE_NOT_FOUND);
|
E(WSASYSNOTREADY);
|
||||||
E(WSAHOST_NOT_FOUND);
|
E(WSAVERNOTSUPPORTED);
|
||||||
E(WSATRY_AGAIN);
|
E(WSANOTINITIALISED);
|
||||||
E(WSANO_RECOVERY);
|
E(WSAEDISCON);
|
||||||
E(WSANO_DATA);
|
E(WSATYPE_NOT_FOUND);
|
||||||
|
E(WSAHOST_NOT_FOUND);
|
||||||
|
E(WSATRY_AGAIN);
|
||||||
|
E(WSANO_RECOVERY);
|
||||||
|
E(WSANO_DATA);
|
||||||
|
}
|
||||||
|
|
||||||
|
s2 = evutil_socket_error_to_string (WSAEINTR);
|
||||||
|
if (s1 != s2)
|
||||||
|
printf ("caching failed!\n");
|
||||||
|
|
||||||
|
libevent_global_shutdown ();
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user