version 1.29, 2005/02/24 23:33:35
|
version 1.30, 2005/02/25 06:39:52
|
|
|
* Unit tests for 32-bit WinSock 1.1 functions in Wine | * Unit tests for 32-bit WinSock 1.1 functions in Wine |
* | * |
* Copyright (c) 2005 Thomas Kho, Fredy Garcia, Douglas Rosenberg | * Copyright (c) 2005 Thomas Kho, Fredy Garcia, Douglas Rosenberg |
|
* standalone boilerplate copyright (c) 2004,2005 Dan Kegel |
* | * |
* This library is free software; you can redistribute it and/or | * This library is free software; you can redistribute it and/or |
* modify it under the terms of the GNU Lesser General Public | * modify it under the terms of the GNU Lesser General Public |
|
|
#include <wtypes.h> | #include <wtypes.h> |
#include <winerror.h> | #include <winerror.h> |
| |
|
/* To build outside Wine tree, compile with cl -DSTANDALONE -D_X86_ wsock32_main.c wsock32.lib */ |
#ifndef STANDALONE | #ifndef STANDALONE |
#include "wine/test.h" | #include "wine/test.h" |
#else | #else |
#include <assert.h> |
#include <stdarg.h> |
|
#include <stdio.h> |
#define START_TEST(name) main(int argc, char **argv) | #define START_TEST(name) main(int argc, char **argv) |
#define ok(condition, msg) \ | #define ok(condition, msg) \ |
do { \ | do { \ |
if(!(condition)) \ | if(!(condition)) \ |
{ \ | { \ |
fprintf(stderr,"failed at %d\n",__LINE__); \ | fprintf(stderr,"failed at %d\n",__LINE__); \ |
exit(0); \ |
exit(1); \ |
} \ | } \ |
} while(0) | } while(0) |
| |
#define todo_wine | #define todo_wine |
|
static void trace(const char *s, ...) |
|
{ |
|
va_list elipsis; |
|
va_start (elipsis, s); |
|
vprintf(s, elipsis); |
|
va_end(elipsis); |
|
} |
#endif | #endif |
| |
// clients threads to create | // clients threads to create |
|
|
// amount of data to transfer from each client to server | // amount of data to transfer from each client to server |
#define TEST_DATA_SIZE 145243 | #define TEST_DATA_SIZE 145243 |
| |
// max time (seconds) to run test |
// max time (seconds) to run test. |
#define TEST_TIMEOUT 10 |
// On a 650 Mhz Linux system with tcpdump running, it takes 8 seconds. |
|
#define TEST_TIMEOUT 20 |
| |
// we often pass this size by reference | // we often pass this size by reference |
int sizeofSOCKADDR_IN = sizeof(SOCKADDR_IN); | int sizeofSOCKADDR_IN = sizeof(SOCKADDR_IN); |
|
|
trace("test 3 of %d:\n", numTests); | trace("test 3 of %d:\n", numTests); |
test_Cleanup(); | test_Cleanup(); |
| |
trace("all tests done\n"); |
trace("all " __FILE__ " tests done\n"); |
| |
free(gTestData); | free(gTestData); |
} | } |