Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
12ae5d4e
Commit
12ae5d4e
authored
May 01, 2006
by
Hans Leidekker
Committed by
Alexandre Julliard
May 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnsapi: Add tests for DnsRecordCompare.
parent
c6c1e05d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
1 deletion
+94
-1
.gitignore
dlls/dnsapi/tests/.gitignore
+1
-0
Makefile.in
dlls/dnsapi/tests/Makefile.in
+2
-1
record.c
dlls/dnsapi/tests/record.c
+91
-0
No files found.
dlls/dnsapi/tests/.gitignore
View file @
12ae5d4e
Makefile
name.ok
record.ok
testlist.c
dlls/dnsapi/tests/Makefile.in
View file @
12ae5d4e
...
...
@@ -6,7 +6,8 @@ TESTDLL = dnsapi.dll
IMPORTS
=
dnsapi kernel32
CTESTS
=
\
name.c
name.c
\
record.c
@MAKE_TEST_RULES@
...
...
dlls/dnsapi/tests/record.c
0 → 100644
View file @
12ae5d4e
/*
* Tests for record 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
*
pDnsRecordCompare
)(
PDNS_RECORD
,
PDNS_RECORD
);
#define GETFUNCPTR(func) p##func = (void *)GetProcAddress( dnsapi, #func ); \
if (!p##func) return FALSE;
static
BOOL
init_function_ptrs
(
void
)
{
GETFUNCPTR
(
DnsRecordCompare
)
return
TRUE
;
}
static
void
test_DnsRecordCompare
(
void
)
{
char
name1
[]
=
"localhost"
;
char
name2
[]
=
"LOCALHOST"
;
static
DNS_RECORDA
r1
,
r2
;
r1
.
pName
=
name1
;
r1
.
wType
=
DNS_TYPE_A
;
r1
.
wDataLength
=
sizeof
(
DNS_A_DATA
);
r1
.
Data
.
A
.
IpAddress
=
0xffffffff
;
r2
.
pName
=
name1
;
r2
.
wType
=
DNS_TYPE_A
;
r2
.
wDataLength
=
sizeof
(
DNS_A_DATA
);
r2
.
Data
.
A
.
IpAddress
=
0xffffffff
;
ok
(
pDnsRecordCompare
(
(
PDNS_RECORD
)
&
r1
,
(
PDNS_RECORD
)
&
r1
)
==
TRUE
,
"failed unexpectedly
\n
"
);
r2
.
pName
=
name2
;
ok
(
pDnsRecordCompare
(
(
PDNS_RECORD
)
&
r1
,
(
PDNS_RECORD
)
&
r2
)
==
TRUE
,
"failed unexpectedly
\n
"
);
r2
.
Flags
.
S
.
CharSet
=
DnsCharSetUnicode
;
ok
(
pDnsRecordCompare
(
(
PDNS_RECORD
)
&
r1
,
(
PDNS_RECORD
)
&
r2
)
==
FALSE
,
"succeeded unexpectedly
\n
"
);
r2
.
Flags
.
S
.
CharSet
=
DnsCharSetAnsi
;
ok
(
pDnsRecordCompare
(
(
PDNS_RECORD
)
&
r1
,
(
PDNS_RECORD
)
&
r2
)
==
FALSE
,
"succeeded unexpectedly
\n
"
);
r1
.
Flags
.
S
.
CharSet
=
DnsCharSetAnsi
;
ok
(
pDnsRecordCompare
(
(
PDNS_RECORD
)
&
r1
,
(
PDNS_RECORD
)
&
r2
)
==
TRUE
,
"failed unexpectedly
\n
"
);
r2
.
Data
.
A
.
IpAddress
=
0
;
ok
(
pDnsRecordCompare
(
(
PDNS_RECORD
)
&
r1
,
(
PDNS_RECORD
)
&
r2
)
==
FALSE
,
"succeeded unexpectedly
\n
"
);
}
START_TEST
(
record
)
{
dnsapi
=
LoadLibraryA
(
"dnsapi.dll"
);
if
(
!
dnsapi
)
return
;
if
(
!
init_function_ptrs
())
{
FreeLibrary
(
dnsapi
);
return
;
}
test_DnsRecordCompare
();
FreeLibrary
(
dnsapi
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment