mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-16 07:45:23 -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,8 +12,15 @@
|
|||||||
|
|
||||||
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 ();
|
||||||
|
|
||||||
|
s1 = evutil_socket_error_to_string (WSAEINTR);
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++) {
|
||||||
|
printf ("\niteration %d:\n\n", i);
|
||||||
E(WSAEINTR);
|
E(WSAEINTR);
|
||||||
E(WSAEACCES);
|
E(WSAEACCES);
|
||||||
E(WSAEFAULT);
|
E(WSAEFAULT);
|
||||||
@ -56,6 +64,13 @@ int main (int argc, char **argv)
|
|||||||
E(WSATRY_AGAIN);
|
E(WSATRY_AGAIN);
|
||||||
E(WSANO_RECOVERY);
|
E(WSANO_RECOVERY);
|
||||||
E(WSANO_DATA);
|
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