ReactOS  0.4.13-dev-99-g7e18b6d
nostartup.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS api tests
3  * LICENSE: GPLv2+ - See COPYING in the top level directory
4  * PURPOSE: Test for WSAStartup
5  * PROGRAMMER: Sylvain Petreolle <sylvain.petreolle@reactos.org>
6  */
7 
8 #include "ws2_32.h"
9 
10 // This test depends on WSAStartup not having been called
11 START_TEST(nostartup)
12 {
13  int Error = 0;
14  ok(WSASocketA(0, 0, 0, NULL, 0, 0) == INVALID_SOCKET, "WSASocketA should have failed\n");
15 
16  WSASetLastError(0xdeadbeef);
20 
21  WSASetLastError(0xdeadbeef);
22  getservbyport(0, NULL);
25 
26  WSASetLastError(0xdeadbeef);
30 
31  ok_dec(inet_addr("127.0.0.1"), 0x100007f);
32 }
#define inet_addr(cp)
Definition: inet.h:98
SOCKET WSAAPI WSASocketA(IN INT af, IN INT type, IN INT protocol, IN LPWSAPROTOCOL_INFOA lpProtocolInfo, IN GROUP g, IN DWORD dwFlags)
Definition: socklife.c:444
START_TEST(nostartup)
Definition: nostartup.c:11
#define ok_dec(expression, result)
Definition: test.h:766
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
VOID WSAAPI WSASetLastError(IN INT iError)
Definition: dllmain.c:123
#define WSANOTINITIALISED
Definition: winerror.h:1987
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
Definition: getxbyxx.c:221
INT WSAAPI WSAGetLastError(VOID)
Definition: dllmain.c:112
PSERVENT WSAAPI getservbyname(IN const char FAR *name, IN const char FAR *proto)
Definition: getxbyxx.c:500
#define INVALID_SOCKET
Definition: winsock.h:332
BOOL Error
Definition: chkdsk.c:66
PSERVENT WSAAPI getservbyport(IN int port, IN const char FAR *proto)
Definition: getxbyxx.c:431