Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5aeb63eb
Commit
5aeb63eb
authored
Aug 08, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Aug 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snmpapi/tests: Run tests again on win98 and NT4.
parent
54f2f60b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
31 deletions
+71
-31
util.c
dlls/snmpapi/tests/util.c
+71
-31
No files found.
dlls/snmpapi/tests/util.c
View file @
5aeb63eb
...
...
@@ -23,6 +23,26 @@
#include <windef.h>
#include <snmp.h>
static
HMODULE
hSnmpapi
=
0
;
static
INT
(
WINAPI
*
pSnmpUtilAsnAnyCpy
)(
AsnAny
*
,
AsnAny
*
);
static
VOID
(
WINAPI
*
pSnmpUtilAsnAnyFree
)(
AsnAny
*
);
static
INT
(
WINAPI
*
pSnmpUtilOctetsCmp
)(
AsnOctetString
*
,
AsnOctetString
*
);
static
INT
(
WINAPI
*
pSnmpUtilOctetsCpy
)(
AsnOctetString
*
,
AsnOctetString
*
);
static
VOID
(
WINAPI
*
pSnmpUtilOctetsFree
)(
AsnOctetString
*
);
static
INT
(
WINAPI
*
pSnmpUtilOctetsNCmp
)(
AsnOctetString
*
,
AsnOctetString
*
,
UINT
);
static
void
InitFunctionPtrs
(
void
)
{
hSnmpapi
=
GetModuleHandle
(
"snmpapi.dll"
);
pSnmpUtilAsnAnyCpy
=
(
void
*
)
GetProcAddress
(
hSnmpapi
,
"SnmpUtilAsnAnyCpy"
);
pSnmpUtilAsnAnyFree
=
(
void
*
)
GetProcAddress
(
hSnmpapi
,
"SnmpUtilAsnAnyFree"
);
pSnmpUtilOctetsCmp
=
(
void
*
)
GetProcAddress
(
hSnmpapi
,
"SnmpUtilOctetsCmp"
);
pSnmpUtilOctetsCpy
=
(
void
*
)
GetProcAddress
(
hSnmpapi
,
"SnmpUtilOctetsCpy"
);
pSnmpUtilOctetsFree
=
(
void
*
)
GetProcAddress
(
hSnmpapi
,
"SnmpUtilOctetsFree"
);
pSnmpUtilOctetsNCmp
=
(
void
*
)
GetProcAddress
(
hSnmpapi
,
"SnmpUtilOctetsNCmp"
);
}
static
void
test_SnmpUtilOidToA
(
void
)
{
LPSTR
ret
;
...
...
@@ -108,24 +128,24 @@ static void test_SnmpUtilAsnAnyCpyFree(void)
static
AsnAny
dst
,
src
=
{
ASN_INTEGER
,
{
1
}
};
if
(
0
)
{
/* these crash on XP */
ret
=
SnmpUtilAsnAnyCpy
(
NULL
,
NULL
);
ret
=
p
SnmpUtilAsnAnyCpy
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilAsnAnyCpy succeeded
\n
"
);
ret
=
SnmpUtilAsnAnyCpy
(
&
dst
,
NULL
);
ret
=
p
SnmpUtilAsnAnyCpy
(
&
dst
,
NULL
);
ok
(
!
ret
,
"SnmpUtilAsnAnyCpy succeeded
\n
"
);
ret
=
SnmpUtilAsnAnyCpy
(
NULL
,
&
src
);
ret
=
p
SnmpUtilAsnAnyCpy
(
NULL
,
&
src
);
ok
(
!
ret
,
"SnmpUtilAsnAnyCpy succeeded
\n
"
);
}
ret
=
SnmpUtilAsnAnyCpy
(
&
dst
,
&
src
);
ret
=
p
SnmpUtilAsnAnyCpy
(
&
dst
,
&
src
);
ok
(
ret
,
"SnmpUtilAsnAnyCpy failed
\n
"
);
ok
(
!
memcmp
(
&
src
,
&
dst
,
sizeof
(
AsnAny
)),
"SnmpUtilAsnAnyCpy failed
\n
"
);
if
(
0
)
{
/* crashes on XP */
SnmpUtilAsnAnyFree
(
NULL
);
p
SnmpUtilAsnAnyFree
(
NULL
);
}
SnmpUtilAsnAnyFree
(
&
dst
);
p
SnmpUtilAsnAnyFree
(
&
dst
);
ok
(
dst
.
asnType
==
ASN_NULL
,
"SnmpUtilAsnAnyFree failed
\n
"
);
ok
(
dst
.
asnValue
.
number
==
1
,
"SnmpUtilAsnAnyFree failed
\n
"
);
}
...
...
@@ -136,28 +156,28 @@ static void test_SnmpUtilOctetsCpyFree(void)
static
BYTE
stream
[]
=
{
'1'
,
'2'
,
'3'
,
'4'
};
static
AsnOctetString
dst
,
src
=
{
stream
,
4
,
TRUE
};
ret
=
SnmpUtilOctetsCpy
(
NULL
,
NULL
);
ret
=
p
SnmpUtilOctetsCpy
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilOctetsCpy succeeded
\n
"
);
memset
(
&
dst
,
1
,
sizeof
(
AsnOctetString
));
ret
=
SnmpUtilOctetsCpy
(
&
dst
,
NULL
);
ret
=
p
SnmpUtilOctetsCpy
(
&
dst
,
NULL
);
ok
(
ret
,
"SnmpUtilOctetsCpy failed
\n
"
);
ok
(
dst
.
length
==
0
,
"SnmpUtilOctetsCpy failed
\n
"
);
ok
(
dst
.
stream
==
NULL
,
"SnmpUtilOctetsCpy failed
\n
"
);
ok
(
dst
.
dynamic
==
FALSE
,
"SnmpUtilOctetsCpy failed
\n
"
);
ret
=
SnmpUtilOctetsCpy
(
NULL
,
&
src
);
ret
=
p
SnmpUtilOctetsCpy
(
NULL
,
&
src
);
ok
(
!
ret
,
"SnmpUtilOctetsCpy succeeded
\n
"
);
memset
(
&
dst
,
0
,
sizeof
(
AsnOctetString
));
ret
=
SnmpUtilOctetsCpy
(
&
dst
,
&
src
);
ret
=
p
SnmpUtilOctetsCpy
(
&
dst
,
&
src
);
ok
(
ret
,
"SnmpUtilOctetsCpy failed
\n
"
);
ok
(
src
.
length
==
dst
.
length
,
"SnmpUtilOctetsCpy failed
\n
"
);
ok
(
!
memcmp
(
src
.
stream
,
dst
.
stream
,
dst
.
length
),
"SnmpUtilOctetsCpy failed
\n
"
);
ok
(
dst
.
dynamic
==
TRUE
,
"SnmpUtilOctetsCpy failed
\n
"
);
SnmpUtilOctetsFree
(
NULL
);
SnmpUtilOctetsFree
(
&
dst
);
p
SnmpUtilOctetsFree
(
NULL
);
p
SnmpUtilOctetsFree
(
&
dst
);
ok
(
dst
.
stream
==
NULL
,
"SnmpUtilOctetsFree failed
\n
"
);
ok
(
dst
.
length
==
0
,
"SnmpUtilOctetsFree failed
\n
"
);
ok
(
dst
.
dynamic
==
FALSE
,
"SnmpUtilOctetsFree failed
\n
"
);
...
...
@@ -201,34 +221,34 @@ static void test_SnmpUtilOctetsNCmp(void)
static
AsnOctetString
octets1
=
{
stream1
,
4
,
FALSE
};
static
AsnOctetString
octets2
=
{
stream2
,
4
,
FALSE
};
ret
=
SnmpUtilOctetsNCmp
(
NULL
,
NULL
,
0
);
ret
=
p
SnmpUtilOctetsNCmp
(
NULL
,
NULL
,
0
);
ok
(
!
ret
,
"SnmpUtilOctetsNCmp succeeded
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
NULL
,
NULL
,
1
);
ret
=
p
SnmpUtilOctetsNCmp
(
NULL
,
NULL
,
1
);
ok
(
!
ret
,
"SnmpUtilOctetsNCmp succeeded
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
&
octets1
,
NULL
,
0
);
ret
=
p
SnmpUtilOctetsNCmp
(
&
octets1
,
NULL
,
0
);
ok
(
!
ret
,
"SnmpUtilOctetsNCmp succeeded
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
&
octets1
,
NULL
,
1
);
ret
=
p
SnmpUtilOctetsNCmp
(
&
octets1
,
NULL
,
1
);
ok
(
!
ret
,
"SnmpUtilOctetsNCmp succeeded
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
NULL
,
&
octets2
,
0
);
ret
=
p
SnmpUtilOctetsNCmp
(
NULL
,
&
octets2
,
0
);
ok
(
!
ret
,
"SnmpUtilOctetsNCmp succeeded
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
NULL
,
&
octets2
,
1
);
ret
=
p
SnmpUtilOctetsNCmp
(
NULL
,
&
octets2
,
1
);
ok
(
!
ret
,
"SnmpUtilOctetsNCmp succeeded
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
&
octets1
,
&
octets1
,
0
);
ret
=
p
SnmpUtilOctetsNCmp
(
&
octets1
,
&
octets1
,
0
);
ok
(
!
ret
,
"SnmpUtilOctetsNCmp failed
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
&
octets1
,
&
octets1
,
4
);
ret
=
p
SnmpUtilOctetsNCmp
(
&
octets1
,
&
octets1
,
4
);
ok
(
!
ret
,
"SnmpUtilOctetsNCmp failed
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
&
octets1
,
&
octets2
,
4
);
ret
=
p
SnmpUtilOctetsNCmp
(
&
octets1
,
&
octets2
,
4
);
ok
(
ret
==
-
4
,
"SnmpUtilOctetsNCmp failed
\n
"
);
ret
=
SnmpUtilOctetsNCmp
(
&
octets2
,
&
octets1
,
4
);
ret
=
p
SnmpUtilOctetsNCmp
(
&
octets2
,
&
octets1
,
4
);
ok
(
ret
==
4
,
"SnmpUtilOctetsNCmp failed
\n
"
);
}
...
...
@@ -241,20 +261,20 @@ static void test_SnmpUtilOctetsCmp(void)
static
AsnOctetString
octets2
=
{
stream2
,
4
,
FALSE
};
if
(
0
)
{
/* these crash on XP */
ret
=
SnmpUtilOctetsCmp
(
NULL
,
NULL
);
ret
=
p
SnmpUtilOctetsCmp
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilOctetsCmp succeeded
\n
"
);
ret
=
SnmpUtilOctetsCmp
(
&
octets1
,
NULL
);
ret
=
p
SnmpUtilOctetsCmp
(
&
octets1
,
NULL
);
ok
(
!
ret
,
"SnmpUtilOctetsCmp succeeded
\n
"
);
ret
=
SnmpUtilOctetsCmp
(
NULL
,
&
octets2
);
ret
=
p
SnmpUtilOctetsCmp
(
NULL
,
&
octets2
);
ok
(
!
ret
,
"SnmpUtilOctetsCmp succeeded
\n
"
);
}
ret
=
SnmpUtilOctetsCmp
(
&
octets2
,
&
octets1
);
ret
=
p
SnmpUtilOctetsCmp
(
&
octets2
,
&
octets1
);
ok
(
ret
==
1
,
"SnmpUtilOctetsCmp failed
\n
"
);
ret
=
SnmpUtilOctetsCmp
(
&
octets1
,
&
octets2
);
ret
=
p
SnmpUtilOctetsCmp
(
&
octets1
,
&
octets2
);
ok
(
ret
==
-
1
,
"SnmpUtilOctetsCmp failed
\n
"
);
}
...
...
@@ -426,12 +446,32 @@ static void test_SnmpUtilVarBindListCpyFree(void)
START_TEST
(
util
)
{
InitFunctionPtrs
();
test_SnmpUtilOidToA
();
test_SnmpUtilAsnAnyCpyFree
();
test_SnmpUtilOctetsCpyFree
();
if
(
!
pSnmpUtilAsnAnyCpy
||
!
pSnmpUtilAsnAnyFree
)
skip
(
"SnmpUtilAsnAnyCpy and/or SnmpUtilAsnAnyFree not available
\n
"
);
else
test_SnmpUtilAsnAnyCpyFree
();
if
(
!
pSnmpUtilOctetsCpy
||
!
pSnmpUtilOctetsFree
)
skip
(
"SnmpUtilOctetsCpy and/or SnmpUtilOctetsFree not available
\n
"
);
else
test_SnmpUtilOctetsCpyFree
();
test_SnmpUtilOidCpyFree
();
test_SnmpUtilOctetsNCmp
();
test_SnmpUtilOctetsCmp
();
if
(
!
pSnmpUtilOctetsNCmp
)
skip
(
"SnmpUtilOctetsNCmp not available
\n
"
);
else
test_SnmpUtilOctetsNCmp
();
if
(
!
pSnmpUtilOctetsCmp
)
skip
(
"SnmpUtilOctetsCmp not available
\n
"
);
else
test_SnmpUtilOctetsCmp
();
test_SnmpUtilOidCmp
();
test_SnmpUtilOidNCmp
();
test_SnmpUtilOidAppend
();
...
...
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