2 * Tests for name handling functions
4 * Copyright 2006 Hans Leidekker
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "wine/test.h"
30 static HMODULE dnsapi;
32 static BOOL (WINAPI *pDnsNameCompare_A)(LPSTR,LPSTR);
34 #define GETFUNCPTR(func) p##func = (void *)GetProcAddress( dnsapi, #func ); \
35 if (!p##func) return FALSE;
37 static BOOL init_function_ptrs( void )
39 GETFUNCPTR( DnsNameCompare_A )
43 static void test_DnsNameCompare_A( void )
45 ok( pDnsNameCompare_A( NULL, NULL ) == TRUE, "failed unexpectedly\n" );
47 ok( pDnsNameCompare_A( "", "" ) == TRUE, "failed unexpectedly\n" );
48 ok( pDnsNameCompare_A( ".", "" ) == TRUE, "failed unexpectedly\n" );
49 ok( pDnsNameCompare_A( "", "." ) == TRUE, "failed unexpectedly\n" );
50 ok( pDnsNameCompare_A( ".", ".." ) == TRUE, "failed unexpectedly\n" );
51 ok( pDnsNameCompare_A( "..", "." ) == TRUE, "failed unexpectedly\n" );
52 ok( pDnsNameCompare_A( "a", "a" ) == TRUE, "failed unexpectedly\n" );
53 ok( pDnsNameCompare_A( "a", "A" ) == TRUE, "failed unexpectedly\n" );
54 ok( pDnsNameCompare_A( "A", "a" ) == TRUE, "failed unexpectedly\n" );
55 ok( pDnsNameCompare_A( "a.b", "A.B" ) == TRUE, "failed unexpectedly\n" );
56 ok( pDnsNameCompare_A( "a.b", "a.b" ) == TRUE, "failed unexpectedly\n" );
57 ok( pDnsNameCompare_A( "a.b.", "a.b." ) == TRUE, "failed unexpectedly\n" );
58 ok( pDnsNameCompare_A( "a.b..", "a.b.." ) == TRUE, "failed unexpectedly\n" );
60 ok( pDnsNameCompare_A( "", NULL ) == FALSE, "succeeded unexpectedly\n" );
61 ok( pDnsNameCompare_A( NULL, "" ) == FALSE, "succeeded unexpectedly\n" );
63 ok( pDnsNameCompare_A( "a", "b" ) == FALSE, "succeeded unexpectedly\n" );
64 ok( pDnsNameCompare_A( "a", "B" ) == FALSE, "succeeded unexpectedly\n" );
65 ok( pDnsNameCompare_A( "A", "b" ) == FALSE, "succeeded unexpectedly\n" );
66 ok( pDnsNameCompare_A( "a.b", "B.A" ) == FALSE, "succeeded unexpectedly\n" );
67 ok( pDnsNameCompare_A( "a.b.", "b.a." ) == FALSE, "succeeded unexpectedly\n" );
68 ok( pDnsNameCompare_A( "a.b", "a.a" ) == FALSE, "succeeded unexpectedly\n" );
69 ok( pDnsNameCompare_A( "a.b..", "b.a.." ) == FALSE, "succeeded unexpectedly\n" );
70 ok( pDnsNameCompare_A( "a.b.", "b.a.." ) == FALSE, "succeeded unexpectedly\n" );
71 ok( pDnsNameCompare_A( "a.b..", "b.a." ) == FALSE, "succeeded unexpectedly\n" );
72 ok( pDnsNameCompare_A( "a.b.", "b.a" ) == FALSE, "succeeded unexpectedly\n" );
73 ok( pDnsNameCompare_A( "a.b", "b.a." ) == FALSE, "succeeded unexpectedly\n" );
78 dnsapi = LoadLibraryA( "dnsapi.dll" );
81 if (!init_function_ptrs())
83 FreeLibrary( dnsapi );
87 test_DnsNameCompare_A();
89 FreeLibrary( dnsapi );