mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 15:13:36 +00:00
[WS2_32_APITEST]
Add WSAStartup-dependent tests. svn path=/trunk/; revision=64480
This commit is contained in:
parent
1979bcce94
commit
4a66664eba
3 changed files with 43 additions and 1 deletions
|
@ -3,6 +3,7 @@ list(APPEND SOURCE
|
|||
getaddrinfo.c
|
||||
helpers.c
|
||||
ioctlsocket.c
|
||||
nostartup.c
|
||||
recv.c
|
||||
WSAStartup.c
|
||||
testlist.c)
|
||||
|
|
40
rostests/apitests/ws2_32/nostartup.c
Normal file
40
rostests/apitests/ws2_32/nostartup.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* PROJECT: ReactOS api tests
|
||||
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
||||
* PURPOSE: Test for WSAStartup
|
||||
* PROGRAMMER: Sylvain Petreolle <sylvain.petreolle@reactos.org>
|
||||
*/
|
||||
|
||||
#include <apitest.h>
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <windef.h>
|
||||
#include <winsock2.h>
|
||||
#include <ndk/rtlfuncs.h>
|
||||
#include <ndk/mmfuncs.h>
|
||||
|
||||
// This test depends on WSAStartup not having been called
|
||||
START_TEST(nostartup)
|
||||
{
|
||||
int Error=0;
|
||||
ok(WSASocketA(0, 0, 0, NULL, 0, 0) == INVALID_SOCKET, "WSASocketA should have failed\n");
|
||||
|
||||
WSASetLastError(0xdeadbeef);
|
||||
getservbyname(NULL,NULL);
|
||||
Error = WSAGetLastError();
|
||||
ok_dec(Error, WSANOTINITIALISED);
|
||||
|
||||
WSASetLastError(0xdeadbeef);
|
||||
getservbyport(0,NULL);
|
||||
Error = WSAGetLastError();
|
||||
ok_dec(Error, WSANOTINITIALISED);
|
||||
|
||||
WSASetLastError(0xdeadbeef);
|
||||
gethostbyname(NULL);
|
||||
Error = WSAGetLastError();
|
||||
ok_dec(Error, WSANOTINITIALISED);
|
||||
|
||||
ok_dec(inet_addr("127.0.0.1"), 0x100007f);
|
||||
}
|
|
@ -7,14 +7,15 @@ extern void func_getaddrinfo(void);
|
|||
extern void func_ioctlsocket(void);
|
||||
extern void func_recv(void);
|
||||
extern void func_WSAStartup(void);
|
||||
extern void func_nostartup(void);
|
||||
|
||||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "getaddrinfo", func_getaddrinfo },
|
||||
{ "ioctlsocket", func_ioctlsocket },
|
||||
{ "nostartup", func_nostartup },
|
||||
{ "recv", func_recv },
|
||||
{ "WSAStartup", func_WSAStartup },
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue