Commit 975899aa authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

dnsapi: Add a test for DnsNameCompare_A.

parent 486e3b32
......@@ -1510,6 +1510,7 @@ dlls/dmsynth/Makefile
dlls/dmusic/Makefile
dlls/dmusic32/Makefile
dlls/dnsapi/Makefile
dlls/dnsapi/tests/Makefile
dlls/dplay/Makefile
dlls/dplayx/Makefile
dlls/dpnet/Makefile
......
......@@ -11,6 +11,8 @@ C_SRCS = \
main.c \
name.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
Makefile
name.ok
testlist.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = dnsapi.dll
IMPORTS = dnsapi kernel32
CTESTS = \
name.c
@MAKE_TEST_RULES@
### Dependencies:
/*
* Tests for name handling functions
*
* Copyright 2006 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "windns.h"
#include "wine/test.h"
static HMODULE dnsapi;
static BOOL (WINAPI *pDnsNameCompare_A)(LPSTR,LPSTR);
#define GETFUNCPTR(func) p##func = (void *)GetProcAddress( dnsapi, #func ); \
if (!p##func) return FALSE;
static BOOL init_function_ptrs( void )
{
GETFUNCPTR( DnsNameCompare_A )
return TRUE;
}
static void test_DnsNameCompare_A( void )
{
ok( pDnsNameCompare_A( NULL, NULL ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "", "" ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( ".", "" ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "", "." ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( ".", ".." ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "..", "." ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "a", "a" ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "a", "A" ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "A", "a" ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b", "A.B" ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b", "a.b" ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b.", "a.b." ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b..", "a.b.." ) == TRUE, "failed unexpectedly\n" );
ok( pDnsNameCompare_A( "", NULL ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( NULL, "" ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a", "b" ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a", "B" ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "A", "b" ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b", "B.A" ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b.", "b.a." ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b", "a.a" ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b..", "b.a.." ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b.", "b.a.." ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b..", "b.a." ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b.", "b.a" ) == FALSE, "succeeded unexpectedly\n" );
ok( pDnsNameCompare_A( "a.b", "b.a." ) == FALSE, "succeeded unexpectedly\n" );
}
START_TEST(name)
{
dnsapi = LoadLibraryA( "dnsapi.dll" );
if (!dnsapi) return;
if (!init_function_ptrs())
{
FreeLibrary( dnsapi );
return;
}
test_DnsNameCompare_A();
FreeLibrary( dnsapi );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment