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
294573a5
Commit
294573a5
authored
Jun 03, 2008
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jun 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snmpapi: Correct snmpapi tests under win98.
parent
b483b680
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
50 deletions
+104
-50
util.c
dlls/snmpapi/tests/util.c
+104
-50
No files found.
dlls/snmpapi/tests/util.c
View file @
294573a5
...
...
@@ -92,10 +92,14 @@ static void test_SnmpUtilOidToA(void)
"1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1"
;
static
const
char
expect4
[]
=
"-1"
;
ret
=
SnmpUtilOidToA
(
NULL
);
ok
(
ret
!=
NULL
,
"SnmpUtilOidToA failed
\n
"
);
ok
(
!
strcmp
(
ret
,
expect0
),
"SnmpUtilOidToA failed got
\n
%s
\n
expected
\n
%s
\n
"
,
ret
,
expect1
);
/* This crashes under win98 */
if
(
0
)
{
ret
=
SnmpUtilOidToA
(
NULL
);
ok
(
ret
!=
NULL
,
"SnmpUtilOidToA failed
\n
"
);
ok
(
!
strcmp
(
ret
,
expect0
),
"SnmpUtilOidToA failed got
\n
%s
\n
expected
\n
%s
\n
"
,
ret
,
expect1
);
}
ret
=
SnmpUtilOidToA
(
&
oid0
);
ok
(
ret
!=
NULL
,
"SnmpUtilOidToA failed
\n
"
);
...
...
@@ -195,17 +199,43 @@ static void test_SnmpUtilOidCpyFree(void)
static
UINT
ids
[]
=
{
1
,
3
,
6
,
1
,
4
,
1
,
311
};
static
AsnObjectIdentifier
dst
,
src
=
{
sizeof
(
ids
)
/
sizeof
(
ids
[
0
]),
ids
};
ret
=
SnmpUtilOidCpy
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilOidCpy succeeded
\n
"
);
/* These crashes under win98 */
if
(
0
)
{
ret
=
SnmpUtilOidCpy
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilOidCpy succeeded
\n
"
);
memset
(
&
dst
,
1
,
sizeof
(
AsnObjectIdentifier
));
ret
=
SnmpUtilOidCpy
(
&
dst
,
NULL
);
ok
(
ret
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
dst
.
idLength
==
0
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
dst
.
ids
==
NULL
,
"SnmpUtilOidCpy failed
\n
"
);
ret
=
SnmpUtilOidCpy
(
NULL
,
&
src
);
ok
(
!
ret
,
"SnmpUtilOidCpy succeeded
\n
"
);
}
memset
(
&
dst
,
1
,
sizeof
(
AsnObjectIdentifier
));
ret
=
SnmpUtilOidCpy
(
&
dst
,
NULL
);
memset
(
&
dst
,
0
,
sizeof
(
AsnObjectIdentifier
));
ret
=
SnmpUtilOidCpy
(
&
dst
,
&
src
);
ok
(
ret
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
dst
.
idLength
==
0
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
dst
.
ids
==
NULL
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
src
.
idLength
==
dst
.
idLength
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
!
memcmp
(
src
.
ids
,
dst
.
ids
,
dst
.
idLength
*
sizeof
(
UINT
))
,
"SnmpUtilOidCpy failed
\n
"
);
ret
=
SnmpUtilOidCpy
(
NULL
,
&
src
);
ok
(
!
ret
,
"SnmpUtilOidCpy succeeded
\n
"
);
/* These crashes under win98 */
if
(
0
)
{
ret
=
SnmpUtilOidCpy
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilOidCpy succeeded
\n
"
);
memset
(
&
dst
,
1
,
sizeof
(
AsnObjectIdentifier
));
ret
=
SnmpUtilOidCpy
(
&
dst
,
NULL
);
ok
(
ret
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
dst
.
idLength
==
0
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
dst
.
ids
==
NULL
,
"SnmpUtilOidCpy failed
\n
"
);
ret
=
SnmpUtilOidCpy
(
NULL
,
&
src
);
ok
(
!
ret
,
"SnmpUtilOidCpy succeeded
\n
"
);
}
memset
(
&
dst
,
0
,
sizeof
(
AsnObjectIdentifier
));
ret
=
SnmpUtilOidCpy
(
&
dst
,
&
src
);
...
...
@@ -213,7 +243,11 @@ static void test_SnmpUtilOidCpyFree(void)
ok
(
src
.
idLength
==
dst
.
idLength
,
"SnmpUtilOidCpy failed
\n
"
);
ok
(
!
memcmp
(
src
.
ids
,
dst
.
ids
,
dst
.
idLength
*
sizeof
(
UINT
)),
"SnmpUtilOidCpy failed
\n
"
);
SnmpUtilOidFree
(
NULL
);
/* This crashes under win98 */
if
(
0
)
{
SnmpUtilOidFree
(
NULL
);
}
SnmpUtilOidFree
(
&
dst
);
ok
(
dst
.
idLength
==
0
,
"SnmpUtilOidFree failed
\n
"
);
ok
(
dst
.
ids
==
NULL
,
"SnmpUtilOidFree failed
\n
"
);
...
...
@@ -292,23 +326,27 @@ static void test_SnmpUtilOidNCmp(void)
static
AsnObjectIdentifier
oid1
=
{
4
,
ids1
};
static
AsnObjectIdentifier
oid2
=
{
4
,
ids2
};
ret
=
SnmpUtilOidNCmp
(
NULL
,
NULL
,
0
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
/* This crashes under win98 */
if
(
0
)
{
ret
=
SnmpUtilOidNCmp
(
NULL
,
NULL
,
0
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
NULL
,
NULL
,
1
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
NULL
,
NULL
,
1
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
&
oid1
,
NULL
,
0
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
&
oid1
,
NULL
,
0
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
&
oid1
,
NULL
,
1
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
&
oid1
,
NULL
,
1
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
NULL
,
&
oid2
,
0
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
NULL
,
&
oid2
,
0
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
NULL
,
&
oid2
,
1
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
ret
=
SnmpUtilOidNCmp
(
NULL
,
&
oid2
,
1
);
ok
(
!
ret
,
"SnmpUtilOidNCmp succeeded
\n
"
);
}
ret
=
SnmpUtilOidNCmp
(
&
oid1
,
&
oid1
,
0
);
ok
(
!
ret
,
"SnmpUtilOidNCmp failed
\n
"
);
...
...
@@ -379,14 +417,18 @@ static void test_SnmpUtilOidAppend(void)
oid1
.
idLength
=
3
;
oid1
.
ids
=
ids1
;
ret
=
SnmpUtilOidAppend
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilOidAppend succeeded
\n
"
);
/* This crashes under win98 */
if
(
0
)
{
ret
=
SnmpUtilOidAppend
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilOidAppend succeeded
\n
"
);
ret
=
SnmpUtilOidAppend
(
&
oid1
,
NULL
);
ok
(
ret
,
"SnmpUtilOidAppend failed
\n
"
);
ret
=
SnmpUtilOidAppend
(
&
oid1
,
NULL
);
ok
(
ret
,
"SnmpUtilOidAppend failed
\n
"
);
ret
=
SnmpUtilOidAppend
(
NULL
,
&
oid2
);
ok
(
!
ret
,
"SnmpUtilOidAppend succeeded
\n
"
);
ret
=
SnmpUtilOidAppend
(
NULL
,
&
oid2
);
ok
(
!
ret
,
"SnmpUtilOidAppend succeeded
\n
"
);
}
ret
=
SnmpUtilOidAppend
(
&
oid1
,
&
oid2
);
ok
(
ret
,
"SnmpUtilOidAppend failed
\n
"
);
...
...
@@ -403,19 +445,23 @@ static void test_SnmpUtilVarBindCpyFree(void)
static
UINT
ids
[]
=
{
1
,
3
,
6
,
1
,
4
,
1
,
311
};
static
SnmpVarBind
dst
,
src
=
{
{
7
,
ids
},
{
ASN_INTEGER
,
{
1
}
}
};
ret
=
SnmpUtilVarBindCpy
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilVarBindCpy succeeded
\n
"
);
memset
(
&
dst
,
0
,
sizeof
(
SnmpVarBind
));
ret
=
SnmpUtilVarBindCpy
(
&
dst
,
NULL
);
ok
(
ret
,
"SnmpUtilVarBindCpy failed
\n
"
);
ok
(
dst
.
name
.
idLength
==
0
,
"SnmpUtilVarBindCpy failed
\n
"
);
ok
(
dst
.
name
.
ids
==
NULL
,
"SnmpUtilVarBindCpy failed
\n
"
);
ok
(
dst
.
value
.
asnType
==
ASN_NULL
,
"SnmpUtilVarBindCpy failed
\n
"
);
ok
(
dst
.
value
.
asnValue
.
number
==
0
,
"SnmpUtilVarBindCpy failed
\n
"
);
ret
=
SnmpUtilVarBindCpy
(
NULL
,
&
src
);
ok
(
!
ret
,
"SnmpUtilVarBindCpy succeeded
\n
"
);
/* This crashes under win98 */
if
(
0
)
{
ret
=
SnmpUtilVarBindCpy
(
NULL
,
NULL
);
ok
(
!
ret
,
"SnmpUtilVarBindCpy succeeded
\n
"
);
memset
(
&
dst
,
0
,
sizeof
(
SnmpVarBind
));
ret
=
SnmpUtilVarBindCpy
(
&
dst
,
NULL
);
ok
(
ret
,
"SnmpUtilVarBindCpy failed
\n
"
);
ok
(
dst
.
name
.
idLength
==
0
,
"SnmpUtilVarBindCpy failed
\n
"
);
ok
(
dst
.
name
.
ids
==
NULL
,
"SnmpUtilVarBindCpy failed
\n
"
);
ok
(
dst
.
value
.
asnType
==
ASN_NULL
,
"SnmpUtilVarBindCpy failed
\n
"
);
ok
(
dst
.
value
.
asnValue
.
number
==
0
,
"SnmpUtilVarBindCpy failed
\n
"
);
ret
=
SnmpUtilVarBindCpy
(
NULL
,
&
src
);
ok
(
!
ret
,
"SnmpUtilVarBindCpy succeeded
\n
"
);
}
memset
(
&
dst
,
0
,
sizeof
(
SnmpVarBind
));
ret
=
SnmpUtilVarBindCpy
(
&
dst
,
&
src
);
...
...
@@ -426,7 +472,11 @@ static void test_SnmpUtilVarBindCpyFree(void)
ok
(
!
memcmp
(
&
src
.
value
,
&
dst
.
value
,
sizeof
(
AsnObjectSyntax
)),
"SnmpUtilVarBindCpy failed
\n
"
);
SnmpUtilVarBindFree
(
NULL
);
/* This crashes under win98 */
if
(
0
)
{
SnmpUtilVarBindFree
(
NULL
);
}
SnmpUtilVarBindFree
(
&
dst
);
ok
(
dst
.
name
.
idLength
==
0
,
"SnmpUtilVarBindFree failed
\n
"
);
ok
(
dst
.
name
.
ids
==
NULL
,
"SnmpUtilVarBindFree failed
\n
"
);
...
...
@@ -449,11 +499,15 @@ static void test_SnmpUtilVarBindListCpyFree(void)
ok
(
!
ret
,
"SnmpUtilVarBindListCpy succeeded
\n
"
);
}
memset
(
&
dst_list
,
0xff
,
sizeof
(
SnmpVarBindList
));
ret
=
SnmpUtilVarBindListCpy
(
&
dst_list
,
NULL
);
ok
(
ret
,
"SnmpUtilVarBindListCpy failed
\n
"
);
ok
(
dst_list
.
list
==
NULL
,
"SnmpUtilVarBindListCpy failed
\n
"
);
ok
(
dst_list
.
len
==
0
,
"SnmpUtilVarBindListCpy failed
\n
"
);
/* This crashes under win98 */
if
(
0
)
{
memset
(
&
dst_list
,
0xff
,
sizeof
(
SnmpVarBindList
));
ret
=
SnmpUtilVarBindListCpy
(
&
dst_list
,
NULL
);
ok
(
ret
,
"SnmpUtilVarBindListCpy failed
\n
"
);
ok
(
dst_list
.
list
==
NULL
,
"SnmpUtilVarBindListCpy failed
\n
"
);
ok
(
dst_list
.
len
==
0
,
"SnmpUtilVarBindListCpy failed
\n
"
);
}
ret
=
SnmpUtilVarBindListCpy
(
&
dst_list
,
&
src_list
);
ok
(
ret
,
"SnmpUtilVarBindListCpy failed
\n
"
);
...
...
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