Forgetting to save really sucks. Sorry again for the wasted commit.
[reactos.git] / rostests / apitests / ws2_32 / ws2_32.h
1 /*
2 * PROJECT: ws2_32.dll API tests
3 * LICENSE: GPLv2 or any later version
4 * FILE: apitests/ws2_32/ws2_32.h
5 * PURPOSE: Main header file
6 * COPYRIGHT: Copyright 2008 Colin Finck <mail@colinfinck.de>
7 */
8
9 #ifndef _WS2_32_APITESTS_H
10 #define _WS2_32_APITESTS_H
11
12 #include <winsock2.h>
13
14 #include "../apitest.h"
15
16 /* Simple macro for executing a socket command and doing cleanup operations in case of a failure */
17 #define SCKTEST(_cmd_) \
18 iResult = _cmd_; \
19 TEST(iResult != SOCKET_ERROR); \
20 if(iResult == SOCKET_ERROR) \
21 { \
22 printf("Winsock error code is %u\n", WSAGetLastError()); \
23 closesocket(sck); \
24 WSACleanup(); \
25 return APISTATUS_ASSERTION_FAILED; \
26 }
27
28 /* helpers.c */
29 int CreateSocket(PTESTINFO pti, SOCKET* sck);
30 int ConnectToReactOSWebsite(PTESTINFO pti, SOCKET sck);
31 int GetRequestAndWait(PTESTINFO pti, SOCKET sck);
32
33 /* ws2_32.c */
34 extern HANDLE g_hHeap;
35
36 #endif