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
9ceddd8d
Commit
9ceddd8d
authored
Mar 01, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msasn1/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
89440f58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
96 deletions
+95
-96
Makefile.in
dlls/msasn1/tests/Makefile.in
+0
-1
asn1.c
dlls/msasn1/tests/asn1.c
+95
-95
No files found.
dlls/msasn1/tests/Makefile.in
View file @
9ceddd8d
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
msasn1.dll
IMPORTS
=
msasn1
...
...
dlls/msasn1/tests/asn1.c
View file @
9ceddd8d
...
...
@@ -47,10 +47,10 @@ static void test_CreateModule(void)
mod
=
ASN1_CreateModule
(
0
,
0
,
0
,
0
,
encfn
,
decfn
,
freefn
,
size
,
0
);
ok
(
!!
mod
,
"Failed to create module.
\n
"
);
ok
(
mod
->
nModuleName
==
0
,
"Got Module name = %d.
\n
"
,
mod
->
nModuleName
);
ok
(
mod
->
nModuleName
==
0
,
"Got Module name = %
l
d.
\n
"
,
mod
->
nModuleName
);
ok
(
mod
->
eRule
==
0
,
"Got eRule = %08x.
\n
"
,
mod
->
eRule
);
ok
(
mod
->
dwFlags
==
0
,
"Got Flags = %08x.
\n
"
,
mod
->
dwFlags
);
ok
(
mod
->
cPDUs
==
0
,
"Got PDUs = %08x.
\n
"
,
mod
->
cPDUs
);
ok
(
mod
->
dwFlags
==
0
,
"Got Flags = %08
l
x.
\n
"
,
mod
->
dwFlags
);
ok
(
mod
->
cPDUs
==
0
,
"Got PDUs = %08
l
x.
\n
"
,
mod
->
cPDUs
);
ok
(
mod
->
apfnFreeMemory
==
freefn
,
"Free function = %p.
\n
"
,
mod
->
apfnFreeMemory
);
ok
(
mod
->
acbStructSize
==
size
,
"Struct size = %p.
\n
"
,
mod
->
acbStructSize
);
ok
(
!
mod
->
PER
.
apfnEncoder
,
"Encoder function should not be set.
\n
"
);
...
...
@@ -59,10 +59,10 @@ static void test_CreateModule(void)
mod
=
ASN1_CreateModule
(
ASN1_THIS_VERSION
,
ASN1_BER_RULE_DER
,
ASN1FLAGS_NOASSERT
,
1
,
encfn
,
decfn
,
freefn
,
size
,
name
);
ok
(
!!
mod
,
"Failed to create module.
\n
"
);
ok
(
mod
->
nModuleName
==
name
,
"Got Module name = %d.
\n
"
,
mod
->
nModuleName
);
ok
(
mod
->
nModuleName
==
name
,
"Got Module name = %
l
d.
\n
"
,
mod
->
nModuleName
);
ok
(
mod
->
eRule
==
ASN1_BER_RULE_DER
,
"Got eRule = %08x.
\n
"
,
mod
->
eRule
);
ok
(
mod
->
cPDUs
==
1
,
"Got PDUs = %08x.
\n
"
,
mod
->
cPDUs
);
ok
(
mod
->
dwFlags
==
ASN1FLAGS_NOASSERT
,
"Got Flags = %08x.
\n
"
,
mod
->
dwFlags
);
ok
(
mod
->
cPDUs
==
1
,
"Got PDUs = %08
l
x.
\n
"
,
mod
->
cPDUs
);
ok
(
mod
->
dwFlags
==
ASN1FLAGS_NOASSERT
,
"Got Flags = %08
l
x.
\n
"
,
mod
->
dwFlags
);
ok
(
mod
->
apfnFreeMemory
==
freefn
,
"Free function = %p.
\n
"
,
mod
->
apfnFreeMemory
);
ok
(
mod
->
acbStructSize
==
size
,
"Struct size = %p.
\n
"
,
mod
->
acbStructSize
);
ok
(
mod
->
BER
.
apfnEncoder
==
(
ASN1BerEncFun_t
*
)
encfn
,
"Encoder function = %p.
\n
"
,
mod
->
BER
.
apfnEncoder
);
...
...
@@ -71,10 +71,10 @@ static void test_CreateModule(void)
mod
=
ASN1_CreateModule
(
ASN1_THIS_VERSION
,
ASN1_PER_RULE_ALIGNED
,
ASN1FLAGS_NOASSERT
,
1
,
encfn
,
decfn
,
freefn
,
size
,
name
);
ok
(
!!
mod
,
"Failed to create module.
\n
"
);
ok
(
mod
->
nModuleName
==
name
,
"Got Module name = %d.
\n
"
,
mod
->
nModuleName
);
ok
(
mod
->
nModuleName
==
name
,
"Got Module name = %
l
d.
\n
"
,
mod
->
nModuleName
);
ok
(
mod
->
eRule
==
ASN1_PER_RULE_ALIGNED
,
"Got eRule = %08x.
\n
"
,
mod
->
eRule
);
ok
(
mod
->
cPDUs
==
1
,
"Got PDUs = %08x.
\n
"
,
mod
->
cPDUs
);
ok
(
mod
->
dwFlags
==
ASN1FLAGS_NOASSERT
,
"Got Flags = %08x.
\n
"
,
mod
->
dwFlags
);
ok
(
mod
->
cPDUs
==
1
,
"Got PDUs = %08
l
x.
\n
"
,
mod
->
cPDUs
);
ok
(
mod
->
dwFlags
==
ASN1FLAGS_NOASSERT
,
"Got Flags = %08
l
x.
\n
"
,
mod
->
dwFlags
);
ok
(
mod
->
apfnFreeMemory
==
freefn
,
"Free function = %p.
\n
"
,
mod
->
apfnFreeMemory
);
ok
(
mod
->
acbStructSize
==
size
,
"Struct size = %p.
\n
"
,
mod
->
acbStructSize
);
ok
(
mod
->
PER
.
apfnEncoder
==
(
ASN1PerEncFun_t
*
)
encfn
/* WINXP & WIN2008 */
||
...
...
@@ -106,79 +106,79 @@ static void test_CreateEncoder(void)
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
NULL
,
0
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
encoder
,
"Encoder creation failed.
\n
"
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08
l
x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
encoder
->
module
);
ok
(
!
encoder
->
buf
,
"Got incorrect buf = %p.
\n
"
,
encoder
->
buf
);
ok
(
!
encoder
->
size
,
"Got incorrect size = %u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %u.
\n
"
,
encoder
->
len
);
ok
(
!
encoder
->
size
,
"Got incorrect size = %
l
u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
encoder
->
err
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
pos
,
"Got incorrect pos = %p.
\n
"
,
encoder
->
pos
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %
l
u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
encoder
->
eRule
==
ASN1_BER_RULE_DER
,
"Got incorrect eRule = %08x.
\n
"
,
encoder
->
eRule
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_NOASSERT
,
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_NOASSERT
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
0
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
encoder
,
"Encoder creation failed.
\n
"
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08
l
x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
encoder
->
module
);
ok
(
!
encoder
->
buf
,
"Got incorrect buf = %p.
\n
"
,
encoder
->
buf
);
ok
(
!
encoder
->
size
,
"Got incorrect size = %u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %u.
\n
"
,
encoder
->
len
);
ok
(
!
encoder
->
size
,
"Got incorrect size = %
l
u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
encoder
->
err
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
pos
,
"Got incorrect pos = %p.
\n
"
,
encoder
->
pos
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %
l
u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
encoder
->
eRule
==
ASN1_BER_RULE_DER
,
"Got incorrect eRule = %08x.
\n
"
,
encoder
->
eRule
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_NOASSERT
,
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_NOASSERT
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
2
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
encoder
,
"Encoder creation failed.
\n
"
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08
l
x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
encoder
->
module
);
ok
(
encoder
->
buf
==
buf
,
"Got incorrect buf = %p.
\n
"
,
encoder
->
buf
);
ok
(
encoder
->
size
==
2
,
"Got incorrect size = %u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
size
==
2
,
"Got incorrect size = %
l
u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
encoder
->
err
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
encoder
->
bit
);
ok
(
encoder
->
pos
==
buf
,
"Got incorrect pos = %p.
\n
"
,
encoder
->
pos
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %
l
u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
encoder
->
eRule
==
ASN1_BER_RULE_DER
,
"Got incorrect eRule = %08x.
\n
"
,
encoder
->
eRule
);
ok
(
encoder
->
dwFlags
==
(
ASN1ENCODE_NOASSERT
|
ASN1ENCODE_SETBUFFER
),
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
(
ASN1ENCODE_NOASSERT
|
ASN1ENCODE_SETBUFFER
),
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
4
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
encoder
,
"Encoder creation failed.
\n
"
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08
l
x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
encoder
->
module
);
ok
(
encoder
->
buf
==
buf
,
"Got incorrect buf = %p.
\n
"
,
encoder
->
buf
);
ok
(
encoder
->
size
==
4
,
"Got incorrect size = %u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
size
==
4
,
"Got incorrect size = %
l
u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
encoder
->
err
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
encoder
->
bit
);
ok
(
encoder
->
pos
==
buf
,
"Got incorrect pos = %p.
\n
"
,
encoder
->
pos
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %
l
u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
encoder
->
eRule
==
ASN1_BER_RULE_DER
,
"Got incorrect rule = %08x.
\n
"
,
encoder
->
eRule
);
ok
(
encoder
->
dwFlags
==
(
ASN1ENCODE_NOASSERT
|
ASN1ENCODE_SETBUFFER
),
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
(
ASN1ENCODE_NOASSERT
|
ASN1ENCODE_SETBUFFER
),
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ASN1_CloseModule
(
mod
);
mod
=
ASN1_CreateModule
(
ASN1_THIS_VERSION
,
ASN1_BER_RULE_DER
,
ASN1FLAGS_NONE
,
1
,
encfn
,
decfn
,
freefn
,
size
,
name
);
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
0
,
NULL
);
ok
(
encoder
->
dwFlags
==
0
,
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
0
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
4
,
NULL
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_SETBUFFER
,
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_SETBUFFER
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ASN1_CloseModule
(
mod
);
...
...
@@ -186,44 +186,44 @@ static void test_CreateEncoder(void)
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
0
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
encoder
,
"Encoder creation failed.
\n
"
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08
l
x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
encoder
->
module
);
ok
(
!
encoder
->
buf
,
"Got incorrect buf = %p.
\n
"
,
encoder
->
buf
);
ok
(
!
encoder
->
size
,
"Got incorrect size = %u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %u.
\n
"
,
encoder
->
len
);
ok
(
!
encoder
->
size
,
"Got incorrect size = %
l
u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
encoder
->
err
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
pos
,
"Got incorrect pos = %p.
\n
"
,
encoder
->
pos
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %
l
u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
encoder
->
eRule
==
ASN1_PER_RULE_ALIGNED
,
"Got incorrect eRule = %08x.
\n
"
,
encoder
->
eRule
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_NOASSERT
,
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_NOASSERT
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
4
,
NULL
);
ok
(
!!
encoder
,
"Encoder creation failed.
\n
"
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
magic
==
0x44434e45
,
"Got invalid magic = %08
l
x.
\n
"
,
encoder
->
magic
);
ok
(
!
encoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
encoder
->
version
);
ok
(
encoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
encoder
->
module
);
ok
(
encoder
->
buf
==
buf
,
"Got incorrect buf = %p.
\n
"
,
encoder
->
buf
);
ok
(
encoder
->
size
==
4
,
"Got incorrect size = %u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
size
==
4
,
"Got incorrect size = %
l
u.
\n
"
,
encoder
->
size
);
ok
(
!
encoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
encoder
->
len
);
ok
(
encoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
encoder
->
err
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
encoder
->
bit
);
ok
(
!
encoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
encoder
->
bit
);
ok
(
encoder
->
pos
==
buf
,
"Got incorrect pos = %p.
\n
"
,
encoder
->
pos
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
!
encoder
->
cbExtraHeader
,
"Got incorrect cbExtraHeader = %
l
u.
\n
"
,
encoder
->
cbExtraHeader
);
ok
(
encoder
->
eRule
==
ASN1_PER_RULE_ALIGNED
,
"Got incorrect rule = %08x.
\n
"
,
encoder
->
eRule
);
ok
(
encoder
->
dwFlags
==
(
ASN1FLAGS_NOASSERT
|
ASN1ENCODE_SETBUFFER
),
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
(
ASN1FLAGS_NOASSERT
|
ASN1ENCODE_SETBUFFER
),
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ASN1_CloseModule
(
mod
);
mod
=
ASN1_CreateModule
(
ASN1_THIS_VERSION
,
ASN1_PER_RULE_ALIGNED
,
ASN1FLAGS_NONE
,
1
,
encfn
,
decfn
,
freefn
,
size
,
name
);
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
0
,
NULL
);
ok
(
encoder
->
dwFlags
==
0
,
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
0
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ret
=
ASN1_CreateEncoder
(
mod
,
&
encoder
,
buf
,
4
,
NULL
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_SETBUFFER
,
"Got incorrect dwFlags = %08x.
\n
"
,
encoder
->
dwFlags
);
ok
(
encoder
->
dwFlags
==
ASN1ENCODE_SETBUFFER
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
encoder
->
dwFlags
);
ASN1_CloseEncoder
(
encoder
);
ASN1_CloseModule
(
mod
);
}
...
...
@@ -250,75 +250,75 @@ static void test_CreateDecoder(void)
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
NULL
,
0
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
decoder
,
"Decoder creation failed.
\n
"
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08
l
x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
decoder
->
module
);
ok
(
!
decoder
->
buf
,
"Got incorrect buf = %p.
\n
"
,
decoder
->
buf
);
ok
(
!
decoder
->
size
,
"Got incorrect size = %u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %u.
\n
"
,
decoder
->
len
);
ok
(
!
decoder
->
size
,
"Got incorrect size = %
l
u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
decoder
->
err
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
decoder
->
bit
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
decoder
->
bit
);
ok
(
!
decoder
->
pos
,
"Got incorrect pos = %p.
\n
"
,
decoder
->
pos
);
ok
(
decoder
->
eRule
==
ASN1_BER_RULE_DER
,
"Got incorrect eRule = %08x.
\n
"
,
decoder
->
eRule
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_NOASSERT
,
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_NOASSERT
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
0
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
decoder
,
"Decoder creation failed.
\n
"
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08
l
x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
decoder
->
module
);
ok
(
decoder
->
buf
==
buf
,
"Got incorrect buf = %s.
\n
"
,
decoder
->
buf
);
ok
(
!
decoder
->
size
,
"Got incorrect size = %u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %u.
\n
"
,
decoder
->
len
);
ok
(
!
decoder
->
size
,
"Got incorrect size = %
l
u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
decoder
->
err
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
decoder
->
bit
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
decoder
->
bit
);
ok
(
decoder
->
pos
==
buf
,
"Got incorrect pos = %s.
\n
"
,
decoder
->
pos
);
ok
(
decoder
->
eRule
==
ASN1_BER_RULE_DER
,
"Got incorrect eRule = %08x.
\n
"
,
decoder
->
eRule
);
ok
(
decoder
->
dwFlags
==
(
ASN1DECODE_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
(
ASN1DECODE_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
2
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
decoder
,
"Decoder creation failed.
\n
"
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08
l
x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
decoder
->
module
);
ok
(
decoder
->
buf
==
buf
,
"Got incorrect buf = %p.
\n
"
,
decoder
->
buf
);
ok
(
decoder
->
size
==
2
,
"Got incorrect size = %u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
size
==
2
,
"Got incorrect size = %
l
u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
decoder
->
err
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
decoder
->
bit
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
decoder
->
bit
);
ok
(
decoder
->
pos
==
buf
,
"Got incorrect pos = %p.
\n
"
,
decoder
->
pos
);
ok
(
decoder
->
eRule
==
ASN1_BER_RULE_DER
,
"Got incorrect eRule = %08x.
\n
"
,
decoder
->
eRule
);
ok
(
decoder
->
dwFlags
==
(
ASN1DECODE_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
(
ASN1DECODE_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
4
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
decoder
,
"Decoder creation failed.
\n
"
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08
l
x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
decoder
->
module
);
ok
(
decoder
->
buf
==
buf
,
"Got incorrect buf = %p.
\n
"
,
decoder
->
buf
);
ok
(
decoder
->
size
==
4
,
"Got incorrect size = %u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
size
==
4
,
"Got incorrect size = %
l
u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
decoder
->
err
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
decoder
->
bit
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
decoder
->
bit
);
ok
(
decoder
->
pos
==
buf
,
"Got incorrect pos = %p.
\n
"
,
decoder
->
pos
);
ok
(
decoder
->
eRule
==
ASN1_BER_RULE_DER
,
"Got incorrect rule = %08x.
\n
"
,
decoder
->
eRule
);
ok
(
decoder
->
dwFlags
==
(
ASN1DECODE_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
(
ASN1DECODE_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ASN1_CloseModule
(
mod
);
mod
=
ASN1_CreateModule
(
ASN1_THIS_VERSION
,
ASN1_BER_RULE_DER
,
ASN1FLAGS_NONE
,
1
,
encfn
,
decfn
,
freefn
,
size
,
name
);
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
0
,
NULL
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_SETBUFFER
,
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_SETBUFFER
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
4
,
NULL
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_SETBUFFER
,
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_SETBUFFER
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ASN1_CloseModule
(
mod
);
...
...
@@ -326,42 +326,42 @@ static void test_CreateDecoder(void)
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
0
,
NULL
);
ok
(
ASN1_SUCCEEDED
(
ret
),
"Got error code %d.
\n
"
,
ret
);
ok
(
!!
decoder
,
"Decoder creation failed.
\n
"
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08
l
x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
decoder
->
module
);
ok
(
decoder
->
buf
==
buf
,
"Got incorrect buf = %s.
\n
"
,
decoder
->
buf
);
ok
(
!
decoder
->
size
,
"Got incorrect size = %u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %u.
\n
"
,
decoder
->
len
);
ok
(
!
decoder
->
size
,
"Got incorrect size = %
l
u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
decoder
->
err
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
decoder
->
bit
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
decoder
->
bit
);
ok
(
decoder
->
pos
==
buf
,
"Got incorrect pos = %s.
\n
"
,
decoder
->
pos
);
ok
(
decoder
->
eRule
==
ASN1_PER_RULE_ALIGNED
,
"Got incorrect eRule = %08x.
\n
"
,
decoder
->
eRule
);
ok
(
decoder
->
dwFlags
==
(
ASN1DECODE_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
(
ASN1DECODE_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
4
,
NULL
);
ok
(
!!
decoder
,
"Decoder creation failed.
\n
"
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
magic
==
0x44434544
,
"Got invalid magic = %08
l
x.
\n
"
,
decoder
->
magic
);
ok
(
!
decoder
->
version
,
"Got incorrect version = %08
l
x.
\n
"
,
decoder
->
version
);
ok
(
decoder
->
module
==
mod
,
"Got incorrect module = %p.
\n
"
,
decoder
->
module
);
ok
(
decoder
->
buf
==
buf
,
"Got incorrect buf = %p.
\n
"
,
decoder
->
buf
);
ok
(
decoder
->
size
==
4
,
"Got incorrect size = %u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
size
==
4
,
"Got incorrect size = %
l
u.
\n
"
,
decoder
->
size
);
ok
(
!
decoder
->
len
,
"Got incorrect length = %
l
u.
\n
"
,
decoder
->
len
);
ok
(
decoder
->
err
==
ASN1_SUCCESS
,
"Got incorrect err = %d.
\n
"
,
decoder
->
err
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %u.
\n
"
,
decoder
->
bit
);
ok
(
!
decoder
->
bit
,
"Got incorrect bit = %
l
u.
\n
"
,
decoder
->
bit
);
ok
(
decoder
->
pos
==
buf
,
"Got incorrect pos = %p.
\n
"
,
decoder
->
pos
);
ok
(
decoder
->
eRule
==
ASN1_PER_RULE_ALIGNED
,
"Got incorrect rule = %08x.
\n
"
,
decoder
->
eRule
);
ok
(
decoder
->
dwFlags
==
(
ASN1FLAGS_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
(
ASN1FLAGS_NOASSERT
|
ASN1DECODE_SETBUFFER
),
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ASN1_CloseModule
(
mod
);
mod
=
ASN1_CreateModule
(
ASN1_THIS_VERSION
,
ASN1_PER_RULE_ALIGNED
,
ASN1FLAGS_NONE
,
1
,
encfn
,
decfn
,
freefn
,
size
,
name
);
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
0
,
NULL
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_SETBUFFER
,
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_SETBUFFER
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ret
=
ASN1_CreateDecoder
(
mod
,
&
decoder
,
buf
,
4
,
NULL
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_SETBUFFER
,
"Got incorrect dwFlags = %08x.
\n
"
,
decoder
->
dwFlags
);
ok
(
decoder
->
dwFlags
==
ASN1DECODE_SETBUFFER
,
"Got incorrect dwFlags = %08
l
x.
\n
"
,
decoder
->
dwFlags
);
ASN1_CloseDecoder
(
decoder
);
ASN1_CloseModule
(
mod
);
}
...
...
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