add ws2_32 winetest from wine 1.1.11

svn path=/trunk/; revision=38464
This commit is contained in:
Christoph von Wittich 2008-12-30 09:04:22 +00:00
parent bba74c7731
commit 8845107b6e
5 changed files with 2501 additions and 0 deletions

View file

@ -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" />

View 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();
}

File diff suppressed because it is too large Load diff

View 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 }
};

View 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>