mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 05:26:58 +00:00
add ws2_32 winetest from wine 1.1.11
svn path=/trunk/; revision=38464
This commit is contained in:
parent
bba74c7731
commit
8845107b6e
|
@ -142,6 +142,9 @@
|
|||
<directory name="wintrust">
|
||||
<xi:include href="wintrust/wintrust.rbuild" />
|
||||
</directory>
|
||||
<directory name="ws2_32">
|
||||
<xi:include href="ws2_32/ws2_32.rbuild" />
|
||||
</directory>
|
||||
<!--
|
||||
<directory name="winetest">
|
||||
<xi:include href="winetest/winetest.rbuild" />
|
||||
|
|
109
rostests/winetests/ws2_32/protocol.c
Normal file
109
rostests/winetests/ws2_32/protocol.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* Unit test suite for protocol functions
|
||||
*
|
||||
* Copyright 2004 Hans Leidekker
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
#include "wine/test.h"
|
||||
|
||||
|
||||
static void test_WSAEnumProtocolsA(void)
|
||||
{
|
||||
INT ret;
|
||||
DWORD len = 0;
|
||||
WSAPROTOCOL_INFOA info, *buffer;
|
||||
|
||||
ret = WSAEnumProtocolsA( NULL, NULL, &len );
|
||||
ok( ret == SOCKET_ERROR, "WSAEnumProtocolsA() succeeded unexpectedly: %d\n",
|
||||
WSAGetLastError() );
|
||||
|
||||
len = 0;
|
||||
|
||||
ret = WSAEnumProtocolsA( NULL, &info, &len );
|
||||
ok( ret == SOCKET_ERROR, "WSAEnumProtocolsA() succeeded unexpectedly: %d\n",
|
||||
WSAGetLastError() );
|
||||
|
||||
buffer = HeapAlloc( GetProcessHeap(), 0, len );
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
INT i;
|
||||
|
||||
ret = WSAEnumProtocolsA( NULL, buffer, &len );
|
||||
ok( ret != SOCKET_ERROR, "WSAEnumProtocolsA() failed unexpectedly: %d\n",
|
||||
WSAGetLastError() );
|
||||
|
||||
for (i = 0; i < ret; i++)
|
||||
{
|
||||
ok( strlen( buffer[i].szProtocol ), "No protocol name found\n" );
|
||||
}
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, buffer );
|
||||
}
|
||||
}
|
||||
|
||||
static void test_WSAEnumProtocolsW(void)
|
||||
{
|
||||
INT ret;
|
||||
DWORD len = 0;
|
||||
WSAPROTOCOL_INFOW info, *buffer;
|
||||
|
||||
ret = WSAEnumProtocolsW( NULL, NULL, &len );
|
||||
ok( ret == SOCKET_ERROR, "WSAEnumProtocolsW() succeeded unexpectedly: %d\n",
|
||||
WSAGetLastError() );
|
||||
|
||||
len = 0;
|
||||
|
||||
ret = WSAEnumProtocolsW( NULL, &info, &len );
|
||||
ok( ret == SOCKET_ERROR, "WSAEnumProtocolsW() succeeded unexpectedly: %d\n",
|
||||
WSAGetLastError() );
|
||||
|
||||
buffer = HeapAlloc( GetProcessHeap(), 0, len );
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
INT i;
|
||||
|
||||
ret = WSAEnumProtocolsW( NULL, buffer, &len );
|
||||
ok( ret != SOCKET_ERROR, "WSAEnumProtocolsW() failed unexpectedly: %d\n",
|
||||
WSAGetLastError() );
|
||||
|
||||
for (i = 0; i < ret; i++)
|
||||
{
|
||||
ok( lstrlenW( buffer[i].szProtocol ), "No protocol name found\n" );
|
||||
}
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, buffer );
|
||||
}
|
||||
}
|
||||
|
||||
START_TEST( protocol )
|
||||
{
|
||||
WSADATA data;
|
||||
WORD version = MAKEWORD( 2, 2 );
|
||||
|
||||
if (WSAStartup( version, &data )) return;
|
||||
|
||||
test_WSAEnumProtocolsA();
|
||||
test_WSAEnumProtocolsW();
|
||||
}
|
2357
rostests/winetests/ws2_32/sock.c
Normal file
2357
rostests/winetests/ws2_32/sock.c
Normal file
File diff suppressed because it is too large
Load diff
17
rostests/winetests/ws2_32/testlist.c
Normal file
17
rostests/winetests/ws2_32/testlist.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* Automatically generated file; DO NOT EDIT!! */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#define STANDALONE
|
||||
#include "wine/test.h"
|
||||
|
||||
extern void func_protocol(void);
|
||||
extern void func_sock(void);
|
||||
|
||||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "protocol", func_protocol },
|
||||
{ "sock", func_sock },
|
||||
{ 0, 0 }
|
||||
};
|
15
rostests/winetests/ws2_32/ws2_32.rbuild
Normal file
15
rostests/winetests/ws2_32/ws2_32.rbuild
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||
<group>
|
||||
<module name="ws2_32_winetest" type="win32cui" installbase="bin" installname="ws2_32_winetest.exe" allowwarnings="true">
|
||||
<compilerflag compiler="cc">-Wno-format</compilerflag>
|
||||
<include base="ws2_32_winetest">.</include>
|
||||
<file>protocol.c</file>
|
||||
<file>sock.c</file>
|
||||
<file>testlist.c</file>
|
||||
<library>wine</library>
|
||||
<library>ws2_32</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
</module>
|
||||
</group>
|
Loading…
Reference in a new issue