make sure caching works, and we don't leak memory

This commit is contained in:
Patrick Pelletier 2013-02-14 20:14:37 -08:00
parent 0c6ec5d816
commit 2078e9b46a

View File

@ -4,6 +4,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "event2/event.h"
#include "event2/util.h"
#include "event2/thread.h"
@ -11,8 +12,15 @@
int main (int argc, char **argv)
{
int i;
const char *s1, *s2;
evthread_use_windows_threads ();
s1 = evutil_socket_error_to_string (WSAEINTR);
for (i = 0; i < 3; i++) {
printf ("\niteration %d:\n\n", i);
E(WSAEINTR);
E(WSAEACCES);
E(WSAEFAULT);
@ -56,6 +64,13 @@ int main (int argc, char **argv)
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;
}