const char *test = "test string";
int pair[2];
+#ifdef WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+#endif
+
if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
return (1);
int
main(int argc, char **argv)
{
+#ifdef WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+#endif
+
/* Initalize the event library */
event_init();
rand_int(int n)
{
#ifdef WIN32
- return (int)(rand() * n);
+ return (int)(rand() % n);
#else
return (int)(random() % n);
#endif
{
struct timeval tv;
int i;
+#ifdef WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+#endif
/* Initalize the event library */
event_init();
{
struct event ev;
+#ifdef WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+#endif
+
#ifndef WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
return (1);
ECHO=echo
fi
-touch "$TEST_OUTPUT_FILE" || exit 1
+if test "$TEST_OUTPUT_FILE" != "/dev/null"
+then
+ touch "$TEST_OUTPUT_FILE" || exit 1
+fi
TEST_DIR=.
EVENT_NOSELECT=yes; export EVENT_NOSELECT
EVENT_NOEPOLL=yes; export EVENT_NOEPOLL
EVENT_NOEVPORT=yes; export EVENT_NOEVPORT
+ EVENT_NOWIN32=yes; export EVENT_NOWIN32
}
announce () {
export EVENT_NOEVPORT
announce "EVPORT"
run_tests
+
+setup
+unset EVENT_NOWIN32
+export EVENT_NOWIN32
+announce "WIN32"
+run_tests