mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[WS2_32_APITEST]
Add WSAStartup-dependent tests. svn path=/trunk/; revision=64480
This commit is contained in:
@@ -3,6 +3,7 @@ list(APPEND SOURCE
|
||||
getaddrinfo.c
|
||||
helpers.c
|
||||
ioctlsocket.c
|
||||
nostartup.c
|
||||
recv.c
|
||||
WSAStartup.c
|
||||
testlist.c)
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* PROJECT: ReactOS api tests
|
||||
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
||||
* PURPOSE: Test for WSAStartup
|
||||
* PROGRAMMER: Sylvain Petreolle <[email protected]>
|
||||
*/
|
||||
|
||||
#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 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user